-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing grp_site object to monitoring module
- Loading branch information
1 parent
cafff23
commit 1043c3f
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...end/gn_module_monitoring/migrations/be30fb5c1a56_add_site_group_object_for_monitoring_.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,37 @@ | ||
"""add site group object for monitoring module | ||
Revision ID: be30fb5c1a56 | ||
Revises: 34253c8fa9b9 | ||
Create Date: 2024-07-12 14:42:28.611638 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'be30fb5c1a56' | ||
down_revision = '34253c8fa9b9' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
""" | ||
INSERT INTO gn_permissions.cor_object_module (id_object ,id_module) | ||
VALUES | ||
((select id_object from gn_permissions.t_objects where code_object = 'MONITORINGS_GRP_SITES'), | ||
(select id_module from gn_commons.t_modules where module_code = 'MONITORINGS')); | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
""" | ||
DELETE FROM gn_permissions.cor_object_module | ||
WHERE id_object = (select id_object from gn_permissions.t_objects where code_object = 'MONITORINGS_GRP_SITES') | ||
AND id_module = (select id_module from gn_commons.t_modules where module_code = 'MONITORINGS'); | ||
""" | ||
) |