Add Color model
This commit is contained in:
parent
260a3b78fe
commit
234f6cca5a
12
models/color.py
Normal file
12
models/color.py
Normal 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())
|
Loading…
x
Reference in New Issue
Block a user