1"""add node backends
2
3Revision ID: 35774c98f945
4Revises: c4fb5f6423a8
5Create Date: 2024-08-01 08:29:56.436001
6
7"""
8
9import sqlalchemy as sa
10from alembic import op
11
12# revision identifiers, used by Alembic.
13revision = "35774c98f945"
14down_revision = "c4fb5f6423a8"
15branch_labels = None
16depends_on = None
17
18
19def upgrade() -> None:
20 # ### commands auto generated by Alembic - please adjust! ###
21 op.create_table(
22 "backends",
23 sa.Column("id", sa.Integer(), nullable=False),
24 sa.Column("name", sa.String(length=64), nullable=False),
25 sa.Column("node_id", sa.Integer(), nullable=True),
26 sa.Column("backend_type", sa.String(length=32), nullable=False),
27 sa.Column("version", sa.String(length=32), nullable=True),
28 sa.Column("running", sa.Boolean(), nullable=False),
29 sa.ForeignKeyConstraint(
30 ["node_id"],
31 ["nodes.id"],
32 ),
33 sa.PrimaryKeyConstraint("id"),
34 )
35 op.create_index(op.f("ix_backends_node_id"), "backends", ["node_id"])
36 # ### end Alembic commands ###
37
38
39def downgrade() -> None:
40 # ### commands auto generated by Alembic - please adjust! ###
41 op.drop_index(op.f("ix_backends_node_id"), table_name="backends")
42 op.drop_table("backends")
43 # ### end Alembic commands ###