pyfedi/migrations/versions/f19d761c216d_themes.py

39 lines
1 KiB
Python
Raw Normal View History

"""themes
Revision ID: f19d761c216d
Revises: 3fb833e34c75
Create Date: 2024-02-07 16:13:47.846365
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f19d761c216d'
down_revision = '3fb833e34c75'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('site', schema=None) as batch_op:
batch_op.add_column(sa.Column('default_theme', sa.String(length=20), nullable=True))
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.add_column(sa.Column('theme', sa.String(length=20), 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('theme')
with op.batch_alter_table('site', schema=None) as batch_op:
batch_op.drop_column('default_theme')
# ### end Alembic commands ###