gitscope
← marzneshin / v0.6.1 / app/db/migrations/versions/74e234a3bd4b_add_mux_fragment_to_hosts.py
https://dev.kronoz.win/r/marzneshin.git
app/db/migrations/versions/74e234a3bd4b_add_mux_fragment_to_hosts.py · Python
Blame Raw
 1"""add fragment settings and mux columns to hosts table
 2
 3Revision ID: 74e234a3bd4b
 4Revises: e8325f600a49
 5Create Date: 2024-05-22 00:26:26.865255
 6
 7"""
 8
 9from alembic import op
10import sqlalchemy as sa
11
12
13# revision identifiers, used by Alembic.
14revision = "74e234a3bd4b"
15down_revision = "e8325f600a49"
16branch_labels = None
17depends_on = None
18
19
20def upgrade() -> None:
21    # ### commands auto generated by Alembic - please adjust! ###
22    op.add_column(
23        "hosts",
24        sa.Column(
25            "mux", sa.Boolean(), server_default=sa.sql.true(), nullable=False
26        ),
27    )
28    op.add_column("hosts", sa.Column("fragment", sa.JSON(), nullable=True))
29    # ### end Alembic commands ###
30
31
32def downgrade() -> None:
33    # ### commands auto generated by Alembic - please adjust! ###
34    op.drop_column("hosts", "fragment")
35    op.drop_column("hosts", "mux")
36    # ### end Alembic commands ###