-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP - adding support for multi-input-field * Adding children and schema to component definition * Add options to page
- Loading branch information
Showing
12 changed files
with
1,185 additions
and
8 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
app/db/migrations/versions/~2024_10_16_1347-da30746cec39_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""Add MultiInputField to ComponentType Enum and columns children and schema to Component. Add column options to Page | ||
Revision ID: da30746cec39 | ||
Revises: ca61d3b746f6 | ||
Create Date: 2024-10-16 13:47:16.968837 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'da30746cec39' | ||
down_revision = 'ca61d3b746f6' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
op.execute("ALTER TYPE componenttype ADD VALUE 'MULTI_INPUT_FIELD';") | ||
with op.batch_alter_table('component', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('children', postgresql.JSON(none_as_null=True, astext_type=sa.Text()), nullable=True)) | ||
batch_op.add_column(sa.Column('schema', postgresql.JSON(astext_type=sa.Text()), nullable=True)) | ||
with op.batch_alter_table('page', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('options', postgresql.JSON(none_as_null=True, astext_type=sa.Text()), nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('component', schema=None) as batch_op: | ||
batch_op.drop_column('children') | ||
batch_op.drop_column('schema') | ||
with op.batch_alter_table('page', schema=None) as batch_op: | ||
batch_op.drop_column('options') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.