diff --git a/app/models.py b/app/models.py index 05017f65..1a3b66ed 100644 --- a/app/models.py +++ b/app/models.py @@ -2124,7 +2124,7 @@ class UserNote(db.Model): class UserExtraField(db.Model): id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), index=True) - label = db.Column(db.String(50)) + label = db.Column(db.String(1024)) text = db.Column(db.String(1024)) diff --git a/migrations/versions/7f163d621f13_increase_field_length.py b/migrations/versions/7f163d621f13_increase_field_length.py new file mode 100644 index 00000000..c32b1a67 --- /dev/null +++ b/migrations/versions/7f163d621f13_increase_field_length.py @@ -0,0 +1,38 @@ +"""increase field length + +Revision ID: 7f163d621f13 +Revises: 03258111eef1 +Create Date: 2025-01-22 08:59:50.114846 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '7f163d621f13' +down_revision = '03258111eef1' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('user_extra_field', schema=None) as batch_op: + batch_op.alter_column('label', + existing_type=sa.VARCHAR(length=50), + 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('user_extra_field', schema=None) as batch_op: + batch_op.alter_column('label', + existing_type=sa.String(length=1024), + type_=sa.VARCHAR(length=50), + existing_nullable=True) + + # ### end Alembic commands ###