Skip to content

Commit

Permalink
updated models and requirements for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
Snickdx committed Mar 10, 2024
1 parent 0959541 commit 9ea2e39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions App/models/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class Listing(db.Model):
listingId = db.Column(db.Integer, primary_key=True)
ownerId = db.Column(db.Integer, db.ForeignKey('customer.id'))
gameId = db.Column(db.Integer, db.ForeignKey('game.gameId'))
condition = db.Column(db.String)
condition = db.Column(db.String(20))
price = db.Column(db.Float)
status = db.Column(db.String)# available, rented, delisted
status = db.Column(db.String(20))# available, rented, delisted
created = db.Column(db.DateTime, default=datetime.utcnow)
rentals = db.relationship('Rental', backref=db.backref('listing', lazy='joined'))

Expand Down
4 changes: 2 additions & 2 deletions App/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
class User(db.Model, UserMixin):
__abstract__ = True
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, nullable=False, unique=True)
user_type = db.Column(db.String, nullable=False)
username = db.Column(db.String(20), nullable=False, unique=True)
user_type = db.Column(db.String(20), nullable=False)
password = db.Column(db.String(120), nullable=False)

def __init__(self, username, password):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Flask-Migrate==3.1.0
requests==2.28.2
mysql-connector-python==8.0.5
Werkzeug==2.2.2
mysqlclient==2.2.4

0 comments on commit 9ea2e39

Please sign in to comment.