feat: Probably functional
This commit is contained in:
@@ -6,14 +6,6 @@ from sqlalchemy.orm import Mapped, mapped_column
|
||||
from .db import Base
|
||||
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
name: Mapped[str] = mapped_column(String)
|
||||
contact: Mapped[int] = mapped_column(Integer, nullable=True)
|
||||
|
||||
|
||||
class Drink(Base):
|
||||
__tablename__ = "drinks"
|
||||
|
||||
@@ -21,7 +13,7 @@ class Drink(Base):
|
||||
name: Mapped[str] = mapped_column(String)
|
||||
price: Mapped[int] = mapped_column(Integer)
|
||||
stock: Mapped[int] = mapped_column(Integer)
|
||||
stocked_by: Mapped[int] = mapped_column(Integer, ForeignKey(User.id))
|
||||
stocked_by: Mapped[str] = mapped_column(String)
|
||||
|
||||
|
||||
# Buys
|
||||
@@ -30,6 +22,6 @@ class Transaction(Base):
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True)
|
||||
drink: Mapped[int] = mapped_column(Integer, ForeignKey(Drink.id))
|
||||
user: Mapped[int] = mapped_column(Integer, ForeignKey(User.id))
|
||||
user_name: Mapped[str] = mapped_column(String)
|
||||
quantity: Mapped[int] = mapped_column(Integer)
|
||||
timestamp: Mapped[datetime] = mapped_column(DateTime)
|
||||
|
||||
Reference in New Issue
Block a user