-
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.
Merge pull request #310 from GispoCoding/239-paluusanoman-käsittely
239 paluusanoman käsittely
- Loading branch information
Showing
25 changed files
with
3,162 additions
and
313 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
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
34 changes: 34 additions & 0 deletions
34
database/migrations/versions/2024_05_21_1823-c84f695b3d22_add_to_be_exported_to_plan.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,34 @@ | ||
"""add to_be_exported to plan | ||
Revision ID: c84f695b3d22 | ||
Revises: 0da11d97b6cb | ||
Create Date: 2024-05-21 18:23:40.322147 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
import geoalchemy2 | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "c84f695b3d22" | ||
down_revision: Union[str, None] = "feb5395835bb" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"plan", | ||
sa.Column("to_be_exported", sa.Boolean(), server_default="f", nullable=False), | ||
schema="hame", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("plan", "to_be_exported", schema="hame") | ||
# ### end Alembic commands ### |
123 changes: 123 additions & 0 deletions
123
database/migrations/versions/2024_06_04_1754-759353efdfdb_add_decisionmaker_type.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,123 @@ | ||
"""add decisionmaker type | ||
Revision ID: 759353efdfdb | ||
Revises: c84f695b3d22 | ||
Create Date: 2024-06-04 17:54:58.513232 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
import geoalchemy2 | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "759353efdfdb" | ||
down_revision: Union[str, None] = "c84f695b3d22" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"type_of_decision_maker", | ||
sa.Column("value", sa.String(), nullable=False), | ||
sa.Column("short_name", sa.String(), server_default="", nullable=False), | ||
sa.Column( | ||
"name", | ||
postgresql.JSONB(astext_type=sa.Text()), | ||
server_default='{"fin": "", "swe": "", "eng": ""}', | ||
nullable=False, | ||
), | ||
sa.Column( | ||
"description", | ||
postgresql.JSONB(astext_type=sa.Text()), | ||
server_default='{"fin": "", "swe": "", "eng": ""}', | ||
nullable=False, | ||
), | ||
sa.Column("status", sa.String(), nullable=False), | ||
sa.Column("level", sa.Integer(), server_default="1", nullable=False), | ||
sa.Column("parent_id", sa.UUID(as_uuid=False), nullable=True), | ||
sa.Column( | ||
"id", | ||
sa.UUID(as_uuid=False), | ||
server_default=sa.text("gen_random_uuid()"), | ||
nullable=False, | ||
), | ||
sa.Column( | ||
"created_at", | ||
sa.DateTime(), | ||
server_default=sa.text("now()"), | ||
nullable=False, | ||
), | ||
sa.Column( | ||
"modified_at", | ||
sa.DateTime(), | ||
server_default=sa.text("now()"), | ||
nullable=False, | ||
), | ||
sa.ForeignKeyConstraint( | ||
["parent_id"], | ||
["codes.type_of_decision_maker.id"], | ||
name="type_of_decision_maker_parent_id_fkey", | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
schema="codes", | ||
) | ||
op.create_index( | ||
op.f("ix_codes_type_of_decision_maker_level"), | ||
"type_of_decision_maker", | ||
["level"], | ||
unique=False, | ||
schema="codes", | ||
) | ||
op.create_index( | ||
op.f("ix_codes_type_of_decision_maker_parent_id"), | ||
"type_of_decision_maker", | ||
["parent_id"], | ||
unique=False, | ||
schema="codes", | ||
) | ||
op.create_index( | ||
op.f("ix_codes_type_of_decision_maker_short_name"), | ||
"type_of_decision_maker", | ||
["short_name"], | ||
unique=False, | ||
schema="codes", | ||
) | ||
op.create_index( | ||
op.f("ix_codes_type_of_decision_maker_value"), | ||
"type_of_decision_maker", | ||
["value"], | ||
unique=True, | ||
schema="codes", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index( | ||
op.f("ix_codes_type_of_decision_maker_value"), | ||
table_name="type_of_decision_maker", | ||
schema="codes", | ||
) | ||
op.drop_index( | ||
op.f("ix_codes_type_of_decision_maker_short_name"), | ||
table_name="type_of_decision_maker", | ||
schema="codes", | ||
) | ||
op.drop_index( | ||
op.f("ix_codes_type_of_decision_maker_parent_id"), | ||
table_name="type_of_decision_maker", | ||
schema="codes", | ||
) | ||
op.drop_index( | ||
op.f("ix_codes_type_of_decision_maker_level"), | ||
table_name="type_of_decision_maker", | ||
schema="codes", | ||
) | ||
op.drop_table("type_of_decision_maker", schema="codes") | ||
# ### end Alembic commands ### |
Oops, something went wrong.