Add Breed model
This commit is contained in:
parent
caa9a718fe
commit
51a6079f26
14
models/breed.py
Normal file
14
models/breed.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from sqlalchemy import Column, String, Integer, DateTime, func
|
||||||
|
from sqlalchemy.dialects.postgresql import UUID
|
||||||
|
from core.database import Base
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
class Breed(Base):
|
||||||
|
__tablename__ = "breeds"
|
||||||
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||||
|
name = Column(String, nullable=False, unique=True, index=True)
|
||||||
|
description = Column(String)
|
||||||
|
origin = Column(String)
|
||||||
|
breed_group = Column(String)
|
||||||
|
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