Skip to content

Commit

Permalink
Create contract.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 8, 2024
1 parent 4a78a5a commit 4133d7d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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'<Contract {self.title}>'

0 comments on commit 4133d7d

Please sign in to comment.