diff --git a/web/migrations/versions/9d21b228d353_.py b/web/migrations/versions/9d21b228d353_.py new file mode 100644 index 00000000..33368bbf --- /dev/null +++ b/web/migrations/versions/9d21b228d353_.py @@ -0,0 +1,50 @@ +"""empty message + +Revision ID: 9d21b228d353 +Revises: 33ec4d09b4ca +Create Date: 2020-07-15 08:58:59.062442 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '9d21b228d353' +down_revision = '33ec4d09b4ca' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('corpus_files', 'author', + existing_type=sa.VARCHAR(length=64), + type_=sa.String(length=255), + existing_nullable=True) + op.alter_column('corpus_files', 'title', + existing_type=sa.VARCHAR(length=64), + type_=sa.String(length=255), + existing_nullable=True) + op.alter_column('roles', 'permissions', + existing_type=sa.INTEGER(), + type_=sa.BigInteger(), + existing_nullable=True) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('roles', 'permissions', + existing_type=sa.BigInteger(), + type_=sa.INTEGER(), + existing_nullable=True) + op.alter_column('corpus_files', 'title', + existing_type=sa.String(length=255), + type_=sa.VARCHAR(length=64), + existing_nullable=True) + op.alter_column('corpus_files', 'author', + existing_type=sa.String(length=255), + type_=sa.VARCHAR(length=64), + existing_nullable=True) + # ### end Alembic commands ### diff --git a/web/nopaque.py b/web/nopaque.py index c26dfa4c..b19c3b87 100644 --- a/web/nopaque.py +++ b/web/nopaque.py @@ -8,7 +8,7 @@ from flask_migrate import Migrate, upgrade import os app = create_app(os.getenv('FLASK_CONFIG') or 'default') -migrate = Migrate(app, db) +migrate = Migrate(app, db, compare_type=True) @app.shell_context_processor