35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
import uuid
|
|
|
|
from barker.models.meta import Base
|
|
from sqlalchemy import Boolean, Column, Integer, Unicode, text
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
|
|
|
|
class ModifierCategory(Base):
|
|
__tablename__ = "modifier_categories"
|
|
|
|
id = Column(
|
|
"id", UUID(as_uuid=True), primary_key=True, server_default=text("gen_random_uuid()"), default=uuid.uuid4
|
|
)
|
|
name = Column("name", Unicode(255), nullable=False, unique=True)
|
|
minimum = Column("minimum", Integer, nullable=False)
|
|
maximum = Column("maximum", Integer, nullable=True)
|
|
is_active = Column("is_active", Boolean, nullable=False)
|
|
sort_order = Column("sort_order", Integer, nullable=False)
|
|
|
|
def __init__(
|
|
self,
|
|
name=None,
|
|
minimum=None,
|
|
maximum=None,
|
|
is_active=True,
|
|
sort_order=0,
|
|
id_=None,
|
|
):
|
|
self.id = id_
|
|
self.name = name
|
|
self.minimum = minimum
|
|
self.maximum = maximum
|
|
self.is_active = is_active
|
|
self.sort_order = sort_order
|