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

@ -3,8 +3,7 @@ import json
class Cosmetics(db.Model):
__tablename__ = "cosmetics"
id = db.Column(db.Integer, primary_key=True) # Auto increment id
user_id = db.Column(db.String(255), nullable=False) # Discord user id of user of cosmetics
user_id = db.Column(db.BigInteger, nullable=False, primary_key=True) # Discord user id of user of cosmetics
css = db.Column(db.Boolean(), nullable=False) # If they can create/edit custom CSS
css_limit = db.Column(db.Integer, nullable=False, server_default="0") # Custom CSS Limit
guest_icon = db.Column(db.Boolean(), nullable=False, server_default=db.false()) # If they can set the guest icon for all guilds