25 lines
695 B
Python
25 lines
695 B
Python
import enum
|
|
|
|
from sqlalchemy import Enum, Float, Integer, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class UncSeries(str, enum.Enum):
|
|
UNC = "UNC"
|
|
UNF = "UNF"
|
|
UNEF = "UNEF"
|
|
UN = "UN"
|
|
UNS = "UNS"
|
|
|
|
|
|
class UncThread(Base):
|
|
__tablename__ = "unc_threads"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
|
diameter_fraction: Mapped[str] = mapped_column(String(16), nullable=False)
|
|
tpi: Mapped[int] = mapped_column(Integer, nullable=False)
|
|
series: Mapped[UncSeries] = mapped_column(Enum(UncSeries), nullable=False)
|
|
depth_in: Mapped[float | None] = mapped_column(Float, nullable=True, default=None)
|