pyfedi/migrations/versions/e76f2067e689_comment_length.py

35 lines
964 B
Python
Raw Permalink Normal View History

2024-05-21 03:20:08 -07:00
"""comment length
Revision ID: e76f2067e689
Revises: 05e3a7023a1e
Create Date: 2024-05-21 21:58:22.133194
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e76f2067e689'
down_revision = '05e3a7023a1e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.add_column(sa.Column('average_comment_length', sa.Integer(), nullable=True))
batch_op.add_column(sa.Column('comment_length_warning', sa.Integer(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.drop_column('comment_length_warning')
batch_op.drop_column('average_comment_length')
# ### end Alembic commands ###