-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deleted values from employee_authorities-mapping
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 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
13 changes: 13 additions & 0 deletions
13
...in/resources/db/changelog/logs/ch-delete-values-employee_authorities-mapping-Spodaryk.xml
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
|
||
<changeSet id="Spodaryk-25" author="Oksana Spodaryk"> | ||
<sqlFile path="db/functions/delete-values-positions_authorities.sql"/> | ||
</changeSet> | ||
<changeSet id="Spodaryk-26" author="Oksana Spodaryk"> | ||
<sqlFile path="db/functions/delete-values-positions_authorities.sql"/> | ||
</changeSet> | ||
</databaseChangeLog> |
22 changes: 22 additions & 0 deletions
22
dao/src/main/resources/db/functions/delete-values-positions_authorities.sql
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,22 @@ | ||
DELETE FROM positions_authorities_mapping AS pam | ||
USING positions AS p | ||
WHERE pam.position_id = p.id | ||
AND p.name_eng = 'Admin' | ||
AND pam.authorities_id IN ( | ||
SELECT id | ||
FROM employee_authorities | ||
WHERE name = 'CREATE_NEW_LOCATION' | ||
OR name = 'CREATE_NEW_COURIER' | ||
OR name = 'CREATE_NEW_STATION' | ||
OR name = 'CREATE_PRICING_CARD' | ||
); | ||
|
||
DELETE FROM positions_authorities_mapping AS pam | ||
USING positions AS p | ||
WHERE pam.position_id = p.id | ||
AND p.name_eng = 'Service Manager' | ||
AND pam.authorities_id IN ( | ||
SELECT id | ||
FROM employee_authorities | ||
WHERE name = 'CREATE_PRICING_CARD' | ||
); |