ambassador map and replace relationships with integer fields

This commit is contained in:
Yisroel Baum 2024-09-16 14:23:24 +03:00
parent 67264b3da6
commit 71d1910988
8 changed files with 17 additions and 6 deletions

Binary file not shown.

View file

@ -11,9 +11,11 @@ class Donation(db.Model):
id = Column('id', INTEGER(), primary_key=True, autoincrement=True)
currency_type = Column('currency_type', TEXT(), nullable=False)
amount = Column('amount', INTEGER(), nullable=False)
user_id = Column('user_id', INTEGER(), nullable=False)
campaign_id = Column('campaign_id', INTEGER(), nullable=False)
user_id = Column(INTEGER, ForeignKey('user.id'))
campaign_id = Column(INTEGER, ForeignKey('campaign.id'))
# user_id = Column(INTEGER, ForeignKey('user.id'))
# campaign_id = Column(INTEGER, ForeignKey('campaign.id'))
def __repr__(self) -> str:
return f"{self.id} - {self.currency_type} - {self.amount}"