gitscope
← marzneshin / nightly / app/db/migrations/versions/20240807_fd423c19f682_add_weight_to_host.py
https://dev.kronoz.win/r/marzneshin.git
app/db/migrations/versions/20240807_fd423c19f682_add_weight_to_host.py · Python
Blame Raw
 1"""add weight to host
 2
 3Revision ID: fd423c19f682
 4Revises: 35774c98f945
 5Create Date: 2024-08-07 19:04:35.197465
 6
 7"""
 8
 9import sqlalchemy as sa
10from alembic import op
11
12# revision identifiers, used by Alembic.
13revision = "fd423c19f682"
14down_revision = "35774c98f945"
15branch_labels = None
16depends_on = None
17
18
19def upgrade() -> None:
20    # ### commands auto generated by Alembic - please adjust! ###
21    op.add_column(
22        "hosts",
23        sa.Column("weight", sa.Integer(), nullable=False, server_default="1"),
24    )
25    # ### end Alembic commands ###
26
27
28def downgrade() -> None:
29    # ### commands auto generated by Alembic - please adjust! ###
30    op.drop_column("hosts", "weight")
31    # ### end Alembic commands ###