server/posts: allow for longer source URLs

Fixes #272
This commit is contained in:
Shyam Sunder 2019-07-27 19:23:25 -04:00
parent 979d8409d5
commit 9b02a0bd5e
2 changed files with 40 additions and 2 deletions

View file

@ -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))

View file

@ -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)