Add Person model
This commit is contained in:
parent
1e0b7a95e9
commit
95f107cde6
17
models/person.py
Normal file
17
models/person.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from sqlalchemy import Column, String, DateTime
|
||||||
|
from sqlalchemy.sql import func
|
||||||
|
from core.database import Base
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
class Person(Base):
|
||||||
|
__tablename__ = "people"
|
||||||
|
|
||||||
|
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||||
|
first_name = Column(String, nullable=False)
|
||||||
|
last_name = Column(String, nullable=False)
|
||||||
|
email = Column(String, unique=True, nullable=False, index=True)
|
||||||
|
phone_number = Column(String)
|
||||||
|
address = 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