gitscope
← marzneshin / v0.3.0 / 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("mux", sa.Boolean(), server_default=sa.sql.true(), nullable=False),
25    )
26    op.add_column("hosts", sa.Column("fragment", sa.JSON(), nullable=True))
27    # ### end Alembic commands ###
28
29
30def downgrade() -> None:
31    # ### commands auto generated by Alembic - please adjust! ###
32    op.drop_column("hosts", "fragment")
33    op.drop_column("hosts", "mux")
34    # ### end Alembic commands ###