Increase task_id column length

This commit is contained in:
rubenwardy 2018-05-23 18:19:29 +01:00
parent 73a7ebc352
commit a0814f4792
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
3 changed files with 37 additions and 2 deletions

@ -392,7 +392,7 @@ class PackageRelease(db.Model):
releaseDate = db.Column(db.DateTime, nullable=False)
url = db.Column(db.String(100), nullable=False)
approved = db.Column(db.Boolean, nullable=False, default=False)
task_id = db.Column(db.String(32), nullable=True)
task_id = db.Column(db.String(37), nullable=True)
def getEditURL(self):

@ -41,7 +41,7 @@ def run_migrations_offline():
"""
url = config.get_main_option("sqlalchemy.url")
context.configure(url=url)
context.configure(url=url, compare_type=True)
with context.begin_transaction():
context.run_migrations()
@ -73,6 +73,7 @@ def run_migrations_online():
context.configure(connection=connection,
target_metadata=target_metadata,
process_revision_directives=process_revision_directives,
compare_type=True,
**current_app.extensions['migrate'].configure_args)
try:

@ -0,0 +1,34 @@
"""empty message
Revision ID: f30031f0b928
Revises: 83622276d439
Create Date: 2018-05-23 18:19:07.428378
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f30031f0b928'
down_revision = '83622276d439'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('package_release', 'task_id',
existing_type=sa.VARCHAR(length=32),
type_=sa.String(length=37),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('package_release', 'task_id',
existing_type=sa.String(length=37),
type_=sa.VARCHAR(length=32),
existing_nullable=True)
# ### end Alembic commands ###