|
| 1 | +"""new products ui column |
| 2 | +
|
| 3 | +Revision ID: 8ec5d2f28966 |
| 4 | +Revises: 68777fdf9539 |
| 5 | +Create Date: 2025-02-12 13:00:37.615966+00:00 |
| 6 | +
|
| 7 | +""" |
| 8 | +import sqlalchemy as sa |
| 9 | +from alembic import op |
| 10 | +from sqlalchemy.dialects import postgresql |
| 11 | + |
| 12 | +# revision identifiers, used by Alembic. |
| 13 | +revision = "8ec5d2f28966" |
| 14 | +down_revision = "68777fdf9539" |
| 15 | +branch_labels = None |
| 16 | +depends_on = None |
| 17 | + |
| 18 | + |
| 19 | +def upgrade(): |
| 20 | + # ### commands auto generated by Alembic - please adjust! ### |
| 21 | + op.alter_column( |
| 22 | + "licensed_resources", |
| 23 | + "licensed_resource_type", |
| 24 | + existing_type=sa.VARCHAR(length=9), |
| 25 | + type_=sa.Enum("VIP_MODEL", name="licensedresourcetype"), |
| 26 | + existing_nullable=False, |
| 27 | + ) |
| 28 | + op.add_column( |
| 29 | + "products", |
| 30 | + sa.Column( |
| 31 | + "ui", |
| 32 | + postgresql.JSONB(astext_type=sa.Text()), |
| 33 | + server_default=sa.text("'{}'::jsonb"), |
| 34 | + nullable=False, |
| 35 | + ), |
| 36 | + ) |
| 37 | + # ### end Alembic commands ### |
| 38 | + |
| 39 | + |
| 40 | +def downgrade(): |
| 41 | + # ### commands auto generated by Alembic - please adjust! ### |
| 42 | + op.drop_column("products", "ui") |
| 43 | + op.alter_column( |
| 44 | + "licensed_resources", |
| 45 | + "licensed_resource_type", |
| 46 | + existing_type=sa.Enum("VIP_MODEL", name="licensedresourcetype"), |
| 47 | + type_=sa.VARCHAR(length=9), |
| 48 | + existing_nullable=False, |
| 49 | + ) |
| 50 | + # ### end Alembic commands ### |
0 commit comments