-
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.
Metadata form versioning - 3 (#1648)
### Feature or Bugfix <!-- please choose --> - Feature ### Detail View: - [ ] Display version on "attached form" card - [ ] Display version in attached form list - [ ] Show number of entities attached (MF -> Fields) - [ ] Delete confirmation PopUp - [ ] Enforcement tab temporary hidden Edit: - [ ] No editing if there are attached entities - [ ] Editing of attached MF - [ ] If new version is available, editing of MF automatically shows new version Other: - [ ] Notifications for entity owners, if new version of MF is released Left ToDo: #1621 (comment) ### Relates - #1621 ### 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
fc2e97e
commit 472060a
Showing
25 changed files
with
535 additions
and
101 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
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
49 changes: 49 additions & 0 deletions
49
backend/migrations/versions/b21f86882012_mf_attached_entity_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,49 @@ | ||
"""mf_attached_entity_type | ||
Revision ID: b21f86882012 | ||
Revises: 5a798acc6282 | ||
Create Date: 2024-10-22 15:50:42.652910 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import orm | ||
|
||
from dataall.modules.metadata_forms.db.metadata_form_models import AttachedMetadataForm | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'b21f86882012' | ||
down_revision = '5a798acc6282' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def get_session(): | ||
bind = op.get_bind() | ||
session = orm.Session(bind=bind) | ||
return session | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
session = get_session() | ||
print('Rename entityType from Dataset to S3-Dataset for attached metadataform entries') | ||
all_amf = session.query(AttachedMetadataForm).all() | ||
for amf in all_amf: | ||
if amf.entityType == 'Dataset': | ||
amf.entityType = 'S3-Dataset' | ||
session.commit() | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
session = get_session() | ||
print('Rename entityType from S3-Dataset to Dataset for attached metadataform entries') | ||
all_amf = session.query(AttachedMetadataForm).all() | ||
for amf in all_amf: | ||
if amf.entityType == 'S3-Dataset': | ||
amf.entityType = 'Dataset' | ||
session.commit() | ||
# ### end Alembic commands ### |
Oops, something went wrong.