Skip to content
Permalink
Browse files

Convert workshop_id to unsigned integer to allow IDs larger than maxint

  • Loading branch information
Smashman committed Aug 17, 2020
1 parent 1173991 commit 8571374e34fd4c2ab531e6386236fe9a5697eccd
@@ -0,0 +1,31 @@
"""Update mod workshop_id type to unsigned integer
Revision ID: 2b597958273b
Revises: 7f0e7d496f6
Create Date: 2020-08-17 01:00:03.055399
"""

# revision identifiers, used by Alembic.
revision = '2b597958273b'
down_revision = '7f0e7d496f6'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql


def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('mods', 'workshop_id',
existing_type=mysql.INTEGER(display_width=11),
type_=mysql.INTEGER(display_width=11,unsigned=True))
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('mods', 'workshop_id',
existing_type=mysql.INTEGER(display_width=11,unsigned=True),
type_=mysql.INTEGER(display_width=11))
### end Alembic commands ###
@@ -1,6 +1,7 @@
from app import db
import datetime
from sqlalchemy.orm.collections import attribute_mapped_collection
from sqlalchemy.dialects.mysql import INTEGER


class ModAuthor(db.Model):
@@ -133,7 +134,7 @@ class Mod(db.Model):
pretty_name = db.Column(db.String(256))
description = db.Column(db.Text())
zip_file = db.Column(db.String(256))
workshop_id = db.Column(db.Integer)
workshop_id = db.Column(INTEGER(unsigned=True))
app = db.Column(db.Integer, default=440)
package_format = db.Column(db.Enum('VPK', 'ZIP', name='package_types'), default='VPK')
manifest_steamid = db.Column(db.Integer)
@@ -13,6 +13,7 @@ Jinja2==2.7.3
Mako==1.0.0
MarkupSafe==0.23
MySQL-python==1.2.5
Pillow==2.5.0
SQLAlchemy==0.9.6
WTForms==1.0.5
Werkzeug==0.9.6

0 comments on commit 8571374

Please sign in to comment.
You can’t perform that action at this time.