Skip to content

Commit

Permalink
add migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Jan 7, 2025
1 parent 5807f81 commit 4573217
Showing 1 changed file with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""Migrate workbench
Revision ID: e11f9d1e3f44
Revises: 307017ee1a49
Create Date: 2025-01-07 10:16:43.305789+00:00
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "e11f9d1e3f44"
down_revision = "307017ee1a49"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("projects_nodes", sa.Column("key", sa.String(), nullable=False))
op.add_column("projects_nodes", sa.Column("version", sa.String(), nullable=False))
op.add_column("projects_nodes", sa.Column("label", sa.String(), nullable=False))
op.add_column("projects_nodes", sa.Column("progress", sa.Numeric(), nullable=True))
op.add_column("projects_nodes", sa.Column("thumbnail", sa.String(), nullable=False))
op.add_column(
"projects_nodes",
sa.Column("inputs", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
)
op.add_column(
"projects_nodes",
sa.Column("outputs", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
)
op.add_column("projects_nodes", sa.Column("run_hash", sa.String(), nullable=True))
op.add_column(
"projects_nodes",
sa.Column("state", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("projects_nodes", "state")
op.drop_column("projects_nodes", "run_hash")
op.drop_column("projects_nodes", "outputs")
op.drop_column("projects_nodes", "inputs")
op.drop_column("projects_nodes", "thumbnail")
op.drop_column("projects_nodes", "progress")
op.drop_column("projects_nodes", "label")
op.drop_column("projects_nodes", "version")
op.drop_column("projects_nodes", "key")
# ### end Alembic commands ###

0 comments on commit 4573217

Please sign in to comment.