diff --git a/server/szurubooru/migrations/versions/3c1f0316fa7f_resize_post_columns.py b/server/szurubooru/migrations/versions/3c1f0316fa7f_resize_post_columns.py new file mode 100644 index 0000000..417803e --- /dev/null +++ b/server/szurubooru/migrations/versions/3c1f0316fa7f_resize_post_columns.py @@ -0,0 +1,38 @@ +''' +resize post columns + +Revision ID: 3c1f0316fa7f +Created at: 2019-07-27 22:29:33.874837 +''' + +import sqlalchemy as sa +from alembic import op + +revision = '3c1f0316fa7f' +down_revision = '1cd4c7b22846' +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column( + 'post', 'flags', + type_=sa.Unicode(32), + existing_type=sa.Unicode(200)) + + op.alter_column( + 'post', 'source', + type_=sa.Unicode(2048), + existing_type=sa.Unicode(200)) + + +def downgrade(): + op.alter_column( + 'post', 'flags', + type_=sa.Unicode(200), + existing_type=sa.Unicode(32)) + + op.alter_column( + 'post', 'source', + type_=sa.Unicode(200), + existing_type=sa.Unicode(2048)) diff --git a/server/szurubooru/model/post.py b/server/szurubooru/model/post.py index bba4c54..30e2900 100644 --- a/server/szurubooru/model/post.py +++ b/server/szurubooru/model/post.py @@ -170,8 +170,8 @@ class Post(Base): creation_time = sa.Column('creation_time', sa.DateTime, nullable=False) last_edit_time = sa.Column('last_edit_time', sa.DateTime) safety = sa.Column('safety', sa.Unicode(32), nullable=False) - source = sa.Column('source', sa.Unicode(200)) - flags_string = sa.Column('flags', sa.Unicode(200), default='') + source = sa.Column('source', sa.Unicode(2048)) + flags_string = sa.Column('flags', sa.Unicode(32), default='') # content description type = sa.Column('type', sa.Unicode(32), nullable=False)