Skip to content
Snippets Groups Projects
Commit 80d2f1b4 authored by Jeyan Kanagaratnam's avatar Jeyan Kanagaratnam
Browse files

Upload New File

parent f2f60388
No related branches found
No related tags found
No related merge requests found
from datetime import datetime
from sqlalchemy import Integer, String, DateTime
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import mapped_column
class Base(DeclarativeBase):
pass
class Customer(Base):
__tablename__ = "customers"
id = mapped_column(String, primary_key=True)
first_name = mapped_column(String(50), nullable=False)
email = mapped_column(String, nullable=False)
class Product(Base):
__tablename__ = "products"
id = mapped_column(String, primary_key=True)
name = mapped_column(String(50), nullable=False)
recycling_type = mapped_column(Integer, nullable=False)
reward_value = mapped_column(Integer, nullable=False)
class Return(Base):
__tablename__ = "returns"
id = mapped_column(String, primary_key=True)
customer_id = mapped_column(String, nullable=False)
product_id = mapped_column(String, nullable=False)
return_date = mapped_column(DateTime, nullable=False, default=datetime.utcnow)
reward_value = mapped_column(Integer, nullable=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment