← marzneshin
/
master
/
app/db/migrations/versions/20241103_c97bd32e6e12_add_noises_to_hosts.py
https://dev.kronoz.win/r/marzneshin.git
1"""add noises to hosts
2
3Revision ID: c97bd32e6e12
4Revises: b613375d2fca
5Create Date: 2024-11-03 03:47:00.293632
6
7"""
8
9import sqlalchemy as sa
10from alembic import op
11
12# revision identifiers, used by Alembic.
13revision = "c97bd32e6e12"
14down_revision = "b613375d2fca"
15branch_labels = None
16depends_on = None
17
18
19def upgrade() -> None:
20 # ### commands auto generated by Alembic - please adjust! ###
21 op.add_column("hosts", sa.Column("udp_noises", sa.JSON(), nullable=True))
22 op.add_column("hosts", sa.Column("http_headers", sa.JSON(), nullable=True))
23 op.add_column(
24 "hosts", sa.Column("dns_servers", sa.String(length=128), nullable=True)
25 )
26 op.add_column("hosts", sa.Column("mtu", sa.Integer(), nullable=True))
27 # ### end Alembic commands ###
28
29
30def downgrade() -> None:
31 # ### commands auto generated by Alembic - please adjust! ###
32 op.drop_column("hosts", "mtu")
33 op.drop_column("hosts", "dns_servers")
34 op.drop_column("hosts", "http_headers")
35 op.drop_column("hosts", "udp_noises")
36 # ### end Alembic commands ###