-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Feature or Bugfix - Bugfix ### Detail - Enum `DatasetType` renamed to `DatasetTypes`. In previous migrations name of the type `datasettypes` is used, so alembic detected it as a change, because automatically generated `DatasetType` -> `datasettype`. - `dataset_lock` is now nullable - Omics models are imported into migrations/env.py - Omics fileds are updated ### Relates - ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - Does this PR introduce or modify any input fields or queries - this includes fetching data from storage outside the application (e.g. a database, an S3 bucket)? - Is the input sanitized? - What precautions are you taking before deserializing the data you consume? - Is injection prevented by parametrizing queries? - Have you ensured no `eval` or similar functions are used? - Does this PR introduce any functionality or component that requires authorization? - How have you ensured it respects the existing AuthN/AuthZ mechanisms? - Are you logging failed auth attempts? - Are you using or adding any cryptographic features? - Do you use a standard proven implementations? - Are the used keys controlled by the customer? Where are they stored? - Are you introducing any new policies/roles/users? - Have you used the least-privilege principle? How? By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Sofia Sazonova <[email protected]>
- Loading branch information
1 parent
d3f98da
commit 94b71c5
Showing
10 changed files
with
100 additions
and
20 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
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
29 changes: 29 additions & 0 deletions
29
backend/migrations/versions/448d9dc95e94_dataset_lock_and_types_adjustment.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,29 @@ | ||
"""dataset_lock_and_types_adjustment | ||
Revision ID: 448d9dc95e94 | ||
Revises: e52fa2b8c887 | ||
Create Date: 2024-06-17 16:42:34.851166 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '448d9dc95e94' | ||
down_revision = 'e52fa2b8c887' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('dataset_lock', 'isLocked', existing_type=sa.BOOLEAN(), nullable=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('dataset_lock', 'isLocked', existing_type=sa.BOOLEAN(), nullable=False) | ||
# ### 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
52 changes: 52 additions & 0 deletions
52
backend/migrations/versions/e52fa2b8c887_omics_adjustments.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,52 @@ | ||
"""omics_adjustments | ||
Revision ID: e52fa2b8c887 | ||
Revises: f2f7431c34e5 | ||
Create Date: 2024-06-17 14:45:06.997065 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'e52fa2b8c887' | ||
down_revision = 'f2f7431c34e5' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('omics_run', 'outputUri', existing_type=sa.VARCHAR(), nullable=True) | ||
op.alter_column('omics_run', 'outputDatasetUri', existing_type=sa.VARCHAR(), nullable=True) | ||
op.create_foreign_key( | ||
'omics_run_workflowUri_fkey', | ||
'omics_run', | ||
'omics_workflow', | ||
['workflowUri'], | ||
['workflowUri'], | ||
ondelete='cascade', | ||
) | ||
op.create_foreign_key( | ||
'omics_run_environmentUri_fkey', | ||
'omics_run', | ||
'environment', | ||
['environmentUri'], | ||
['environmentUri'], | ||
ondelete='cascade', | ||
) | ||
op.alter_column('omics_workflow', 'environmentUri', existing_type=sa.VARCHAR(), nullable=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('omics_workflow', 'environmentUri', existing_type=sa.VARCHAR(), nullable=False) | ||
op.drop_constraint('omics_run_workflowUri_fkey', 'omics_run', type_='foreignkey') | ||
op.drop_constraint('omics_run_environmentUri_fkey', 'omics_run', type_='foreignkey') | ||
op.alter_column('omics_run', 'outputDatasetUri', existing_type=sa.VARCHAR(), nullable=False) | ||
op.alter_column('omics_run', 'outputUri', existing_type=sa.VARCHAR(), nullable=False) | ||
|
||
# ### end Alembic commands ### |