Add Color model

This commit is contained in:
Backend IM Bot 2025-03-26 16:57:32 +00:00
parent 260a3b78fe
commit 234f6cca5a

12
models/color.py Normal file
View File

@ -0,0 +1,12 @@
from sqlalchemy import Column, String, DateTime
from sqlalchemy.sql import func
from core.database import Base
import uuid
class Color(Base):
__tablename__ = "colors"
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
name = Column(String, nullable=False, index=True)
hex_code = Column(String(7), nullable=False)
created_at = Column(DateTime, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())