user extra field - increase label field length

This commit is contained in:
rimu 2025-01-22 09:00:20 +13:00
parent b98e866a14
commit 2aa0d50404
2 changed files with 39 additions and 1 deletions

View file

@ -2124,7 +2124,7 @@ class UserNote(db.Model):
class UserExtraField(db.Model): class UserExtraField(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), index=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)) text = db.Column(db.String(1024))

View file

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