24 lines
552 B
Python
24 lines
552 B
Python
"""add habit position
|
|
|
|
Revision ID: 0012_habit_position
|
|
Revises: 0011_lunar_countdowns
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision = "0012_habit_position"
|
|
down_revision = "0011_lunar_countdowns"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table("habits") as batch_op:
|
|
batch_op.add_column(sa.Column("position", sa.Integer(), nullable=False, server_default="0"))
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table("habits") as batch_op:
|
|
batch_op.drop_column("position")
|