13 lines
344 B
Python
13 lines
344 B
Python
from sqlalchemy import UniqueConstraint
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.database import Base
|
|
|
|
|
|
class PartColour(Base):
|
|
__tablename__ = "part_colours"
|
|
__table_args__ = (UniqueConstraint("name"),)
|
|
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
name: Mapped[str] = mapped_column(nullable=False)
|