link.py 676 B

123456789101112131415161718
  1. import datetime
  2. import uuid
  3. from sqlalchemy import Column, String
  4. from sqlalchemy.sql.schema import ForeignKey
  5. from sqlalchemy.sql.sqltypes import DateTime
  6. from app.db.base_class import Base
  7. class Link(Base):
  8. id = Column(String(36), primary_key=True, nullable=False, default=uuid.uuid4())
  9. created_at = Column(DateTime, default=datetime.datetime.now(), nullable=False)
  10. updated_at = Column(DateTime, default=datetime.datetime.now(), nullable=False)
  11. facebook = Column(String(100))
  12. instagram = Column(String(100))
  13. blog = Column(String(100))
  14. youtube = Column(String(100))
  15. creator_id = Column(String(36), ForeignKey("creator.id"), nullable=False)