diff --git a/app/models.py b/app/models.py index 362e5dce..ed172714 100644 --- a/app/models.py +++ b/app/models.py @@ -83,7 +83,7 @@ class File(db.Model): width = db.Column(db.Integer) height = db.Column(db.Integer) alt_text = db.Column(db.String(256)) - source_url = db.Column(db.String(256)) + source_url = db.Column(db.String(1024)) thumbnail_path = db.Column(db.String(255)) thumbnail_width = db.Column(db.Integer) thumbnail_height = db.Column(db.Integer) diff --git a/migrations/versions/62cbf0bf515a_longer_file_source_url.py b/migrations/versions/62cbf0bf515a_longer_file_source_url.py new file mode 100644 index 00000000..9b97baed --- /dev/null +++ b/migrations/versions/62cbf0bf515a_longer_file_source_url.py @@ -0,0 +1,38 @@ +"""longer file source_url + +Revision ID: 62cbf0bf515a +Revises: d37fe77e043c +Create Date: 2024-02-13 06:50:03.712804 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '62cbf0bf515a' +down_revision = 'd37fe77e043c' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('file', schema=None) as batch_op: + batch_op.alter_column('source_url', + existing_type=sa.VARCHAR(length=256), + type_=sa.String(length=1024), + existing_nullable=True) + + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('file', schema=None) as batch_op: + batch_op.alter_column('source_url', + existing_type=sa.String(length=1024), + type_=sa.VARCHAR(length=256), + existing_nullable=True) + + # ### end Alembic commands ###