mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""downvote accept mode
|
|
|
|
Revision ID: 03258111eef1
|
|
Revises: 9df13396fd54
|
|
Create Date: 2025-01-11 11:32:54.226698
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '03258111eef1'
|
|
down_revision = '9df13396fd54'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('community', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('downvote_accept_mode', sa.Integer(), nullable=True))
|
|
|
|
with op.batch_alter_table('community', schema=None) as batch_op:
|
|
batch_op.execute('UPDATE "community" SET downvote_accept_mode = 0')
|
|
|
|
with op.batch_alter_table('instance', schema=None) as batch_op:
|
|
batch_op.create_index(batch_op.f('ix_instance_trusted'), ['trusted'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('instance', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_instance_trusted'))
|
|
|
|
with op.batch_alter_table('community', schema=None) as batch_op:
|
|
batch_op.drop_column('downvote_accept_mode')
|
|
|
|
# ### end Alembic commands ###
|