Add app/models.py
This commit is contained in:
parent
883656b1a4
commit
dc38f256aa
1 changed files with 20 additions and 0 deletions
20
app/models.py
Normal file
20
app/models.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from sqlalchemy import Column, Integer, String, Float, Date
|
||||
from app.database import Base
|
||||
|
||||
class Customer(Base):
|
||||
__tablename__ = "customers"
|
||||
customer_id = Column(Integer, primary_key=True, index=True)
|
||||
full_name = Column(String, index=True)
|
||||
email = Column(String, unique=True)
|
||||
phone = Column(String)
|
||||
home_branch_id = Column(Integer)
|
||||
customer_since = Column(Date)
|
||||
|
||||
class Account(Base):
|
||||
__tablename__ = "accounts"
|
||||
account_id = Column(Integer, primary_key=True, index=True)
|
||||
account_number = Column(String, unique=True, index=True)
|
||||
customer_id = Column(Integer)
|
||||
account_type = Column(String)
|
||||
open_date = Column(Date)
|
||||
balance = Column(Float)
|
||||
Loading…
Reference in a new issue