-
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.
- Loading branch information
Showing
23 changed files
with
1,020 additions
and
155 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
app/db/migrations/versions/~2024_07_16_0850-eb66c0e87001_.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,32 @@ | ||
"""Adding is_template to list table | ||
Revision ID: eb66c0e87001 | ||
Revises: 4247b8f71cff | ||
Create Date: 2024-07-16 08:50:01.637018 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "eb66c0e87001" | ||
down_revision = "4247b8f71cff" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("lizt", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("is_template", sa.Boolean(), nullable=False)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("lizt", schema=None) as batch_op: | ||
batch_op.drop_column("is_template") | ||
|
||
# ### end Alembic commands ### |
33 changes: 33 additions & 0 deletions
33
app/db/migrations/versions/~2024_07_16_0921-e58b1e674060_.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,33 @@ | ||
"""Add unique index on Page.display_path when is_template is true | ||
Revision ID: e58b1e674060 | ||
Revises: eb66c0e87001 | ||
Create Date: 2024-07-16 09:21:52.877957 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e58b1e674060" | ||
down_revision = "eb66c0e87001" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("page", schema=None) as batch_op: | ||
batch_op.create_index( | ||
"ix_template_page_name", ["display_path"], unique=True, postgresql_where="Page.is_template = true" | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("page", schema=None) as batch_op: | ||
batch_op.drop_index("ix_template_page_name", postgresql_where="Page.is_template = true") | ||
|
||
# ### end Alembic commands ### |
58 changes: 58 additions & 0 deletions
58
app/db/migrations/versions/~2024_07_17_1202-5c63de4e4e49_.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,58 @@ | ||
"""Rename template name columns | ||
Revision ID: 5c63de4e4e49 | ||
Revises: e58b1e674060 | ||
Create Date: 2024-07-17 12:02:11.799787 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "5c63de4e4e49" | ||
down_revision = "e58b1e674060" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("component", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("template_name", sa.String(), nullable=True)) | ||
batch_op.drop_column("Template Name") | ||
|
||
with op.batch_alter_table("form", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("template_name", sa.String(), nullable=True)) | ||
batch_op.drop_column("Template Name") | ||
|
||
with op.batch_alter_table("page", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("template_name", sa.String(), nullable=True)) | ||
batch_op.drop_column("Template Name") | ||
|
||
with op.batch_alter_table("section", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("template_name", sa.String(), nullable=True)) | ||
batch_op.drop_column("Template Name") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("section", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("Template Name", sa.VARCHAR(), autoincrement=False, nullable=True)) | ||
batch_op.drop_column("template_name") | ||
|
||
with op.batch_alter_table("page", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("Template Name", sa.VARCHAR(), autoincrement=False, nullable=True)) | ||
batch_op.drop_column("template_name") | ||
|
||
with op.batch_alter_table("form", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("Template Name", sa.VARCHAR(), autoincrement=False, nullable=True)) | ||
batch_op.drop_column("template_name") | ||
|
||
with op.batch_alter_table("component", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("Template Name", sa.VARCHAR(), autoincrement=False, nullable=True)) | ||
batch_op.drop_column("template_name") | ||
|
||
# ### 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
Oops, something went wrong.