-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/planning/adapt-scheduler-multiple-output' into …
…feature/planning/update-tests-multiple-output
- Loading branch information
Showing
8 changed files
with
212 additions
and
36 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
46 changes: 46 additions & 0 deletions
46
...measures/data/migrations/versions/a60cc43aef5e_delete_children_assets_on_cascade_when_.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,46 @@ | ||
"""Delete children assets on cascade when deleting an asset. | ||
Revision ID: a60cc43aef5e | ||
Revises: ac5e340cccea | ||
Create Date: 2023-10-11 14:04:19.447773 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "a60cc43aef5e" | ||
down_revision = "ac5e340cccea" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.drop_constraint( | ||
"generic_asset_parent_asset_id_generic_asset_fkey", | ||
"generic_asset", | ||
type_="foreignkey", | ||
) | ||
op.create_foreign_key( | ||
None, | ||
"generic_asset", | ||
"generic_asset", | ||
["parent_asset_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint( | ||
"generic_asset_parent_asset_id_generic_asset_fkey", | ||
"generic_asset", | ||
type_="foreignkey", | ||
) | ||
op.create_foreign_key( | ||
None, | ||
"generic_asset", | ||
"generic_asset", | ||
["parent_asset_id"], | ||
["id"], | ||
) |
39 changes: 39 additions & 0 deletions
39
...ata/migrations/versions/ac5e340cccea_change_scope_of_name_account_id_unique_constraint.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,39 @@ | ||
"""Change the scope of the unique (name, account_id) constraint to | ||
restricts the name to be unique among the sibling assets. | ||
Drop generic_asset_name_account_id_key constraint | ||
Revision ID: ac5e340cccea | ||
Revises: 40d6c8e4be94 | ||
Create Date: 2023-10-05 15:13:36.641051 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "ac5e340cccea" | ||
down_revision = "40d6c8e4be94" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_unique_constraint( | ||
"generic_asset_name_parent_asset_id_key", | ||
"generic_asset", | ||
["name", "parent_asset_id"], | ||
) | ||
|
||
op.drop_constraint( | ||
"generic_asset_name_account_id_key", "generic_asset", type_="unique" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.create_unique_constraint( | ||
"generic_asset_name_account_id_key", "generic_asset", ["name", "account_id"] | ||
) | ||
op.drop_constraint( | ||
"generic_asset_name_parent_asset_id_key", "generic_asset", type_="unique" | ||
) |
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