34 lines
1014 B
Python
34 lines
1014 B
Python
"""add lunar calendar fields to countdowns
|
|
|
|
Revision ID: 0011_lunar_countdowns
|
|
Revises: 0010
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "0011_lunar_countdowns"
|
|
down_revision = "0010"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("countdowns") as batch_op:
|
|
batch_op.add_column(
|
|
sa.Column("calendar_mode", sa.String(8), nullable=False, server_default="solar")
|
|
)
|
|
batch_op.add_column(sa.Column("lunar_month", sa.Integer(), nullable=True))
|
|
batch_op.add_column(sa.Column("lunar_day", sa.Integer(), nullable=True))
|
|
batch_op.add_column(
|
|
sa.Column("ignore_year", sa.Boolean(), nullable=False, server_default=sa.false())
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("countdowns") as batch_op:
|
|
batch_op.drop_column("ignore_year")
|
|
batch_op.drop_column("lunar_day")
|
|
batch_op.drop_column("lunar_month")
|
|
batch_op.drop_column("calendar_mode")
|