Feat/update tools length (#7141)

This commit is contained in:
crazywoola 2024-08-09 16:07:37 +08:00 committed by GitHub
parent 425174e82f
commit f667ef98cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,39 @@
"""update tools original_url length
Revision ID: 1787fbae959a
Revises: eeb2e349e6ac
Create Date: 2024-08-09 08:01:12.817620
"""
import sqlalchemy as sa
from alembic import op
import models as models
# revision identifiers, used by Alembic.
revision = '1787fbae959a'
down_revision = 'eeb2e349e6ac'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('tool_files', schema=None) as batch_op:
batch_op.alter_column('original_url',
existing_type=sa.VARCHAR(length=255),
type_=sa.String(length=2048),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('tool_files', schema=None) as batch_op:
batch_op.alter_column('original_url',
existing_type=sa.String(length=2048),
type_=sa.VARCHAR(length=255),
existing_nullable=True)
# ### end Alembic commands ###

View File

@ -299,4 +299,4 @@ class ToolFile(db.Model):
# mime type
mimetype = db.Column(db.String(255), nullable=False)
# original url
original_url = db.Column(db.String(255), nullable=True)
original_url = db.Column(db.String(2048), nullable=True)