diff --git a/projects/ContractSphere/data_storage/contract-sphere-db/models/contract.py b/projects/ContractSphere/data_storage/contract-sphere-db/models/contract.py new file mode 100644 index 000000000..1e4435415 --- /dev/null +++ b/projects/ContractSphere/data_storage/contract-sphere-db/models/contract.py @@ -0,0 +1,16 @@ +from sqlalchemy import Column, Integer, String, DateTime +from sqlalchemy.ext.declarative import declarative_base + +Base = declarative_base() + +class Contract(Base): + __tablename__ = 'contracts' + + id = Column(Integer, primary_key=True) + title = Column(String(255), nullable=False) + description = Column(String, nullable=True) + created_at = Column(DateTime, default=datetime.utcnow) + updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) + + def __repr__(self): + return f''