Use a more optimal primary key and integer to store snowflakes

This commit is contained in:
Jeremy Zhang
2018-01-23 21:08:55 +00:00
parent ff42f4195b
commit aa199ad818
24 changed files with 246 additions and 84 deletions

View File

@ -2,8 +2,7 @@ from titanembeds.database import db
class Patreon(db.Model):
__tablename__ = "patreon"
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String(255), nullable=False) # User ID from patreon
user_id = db.Column(db.BigInteger, nullable=False, primary_key=True) # User ID from patreon
total_synced = db.Column(db.Integer, nullable=False) # Total cents synced on our end
def __init__(self, user_id, total_synced=0):