https://dev.kronoz.win/r/marzneshin.git
| 1 |
4056c66 |
Dawsh |
1y ago |
"""implement host chains |
| 2 |
4056c66 |
Dawsh |
1y ago |
|
| 3 |
4056c66 |
Dawsh |
1y ago |
Revision ID: 982867b533e6 |
| 4 |
4056c66 |
Dawsh |
1y ago |
Revises: 79271458a973 |
| 5 |
4056c66 |
Dawsh |
1y ago |
Create Date: 2024-12-15 04:27:44.704707 |
| 6 |
4056c66 |
Dawsh |
1y ago |
|
| 7 |
4056c66 |
Dawsh |
1y ago |
""" |
| 8 |
4056c66 |
Dawsh |
1y ago |
|
| 9 |
4056c66 |
Dawsh |
1y ago |
import sqlalchemy as sa |
| 10 |
4056c66 |
Dawsh |
1y ago |
from alembic import op |
| 11 |
4056c66 |
Dawsh |
1y ago |
|
| 12 |
4056c66 |
Dawsh |
1y ago |
# revision identifiers, used by Alembic. |
| 13 |
4056c66 |
Dawsh |
1y ago |
revision = "982867b533e6" |
| 14 |
4056c66 |
Dawsh |
1y ago |
down_revision = "79271458a973" |
| 15 |
4056c66 |
Dawsh |
1y ago |
branch_labels = None |
| 16 |
4056c66 |
Dawsh |
1y ago |
depends_on = None |
| 17 |
4056c66 |
Dawsh |
1y ago |
|
| 18 |
4056c66 |
Dawsh |
1y ago |
|
| 19 |
4056c66 |
Dawsh |
1y ago |
def upgrade() -> None: |
| 20 |
4056c66 |
Dawsh |
1y ago |
# ### commands auto generated by Alembic - please adjust! ### |
| 21 |
4056c66 |
Dawsh |
1y ago |
op.create_table( |
| 22 |
4056c66 |
Dawsh |
1y ago |
"host_chains", |
| 23 |
4056c66 |
Dawsh |
1y ago |
sa.Column("host_id", sa.Integer(), nullable=False), |
| 24 |
4056c66 |
Dawsh |
1y ago |
sa.Column("chained_host_id", sa.Integer(), nullable=True), |
| 25 |
4056c66 |
Dawsh |
1y ago |
sa.Column("seq", sa.Integer(), nullable=False), |
| 26 |
4056c66 |
Dawsh |
1y ago |
sa.ForeignKeyConstraint( |
| 27 |
4056c66 |
Dawsh |
1y ago |
["chained_host_id"], |
| 28 |
4056c66 |
Dawsh |
1y ago |
["hosts.id"], |
| 29 |
4056c66 |
Dawsh |
1y ago |
), |
| 30 |
4056c66 |
Dawsh |
1y ago |
sa.ForeignKeyConstraint( |
| 31 |
4056c66 |
Dawsh |
1y ago |
["host_id"], |
| 32 |
4056c66 |
Dawsh |
1y ago |
["hosts.id"], |
| 33 |
4056c66 |
Dawsh |
1y ago |
), |
| 34 |
4056c66 |
Dawsh |
1y ago |
sa.PrimaryKeyConstraint("host_id", "seq"), |
| 35 |
4056c66 |
Dawsh |
1y ago |
) |
| 36 |
4056c66 |
Dawsh |
1y ago |
# ### end Alembic commands ### |
| 37 |
4056c66 |
Dawsh |
1y ago |
|
| 38 |
4056c66 |
Dawsh |
1y ago |
|
| 39 |
4056c66 |
Dawsh |
1y ago |
def downgrade() -> None: |
| 40 |
4056c66 |
Dawsh |
1y ago |
# ### commands auto generated by Alembic - please adjust! ### |
| 41 |
4056c66 |
Dawsh |
1y ago |
op.drop_table("host_chains") |
| 42 |
4056c66 |
Dawsh |
1y ago |
# ### end Alembic commands ### |