Skip to content

Commit

Permalink
Deleted values from employee_authorities-mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ospodaryk committed Sep 26, 2023
1 parent 697ce48 commit f5aac1e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@
<include file="db/changelog/logs/ch-delete-from-fact_of_the_day_translations-Spodaryk.xml"/>
<include file="db/changelog/logs/ch-delete-from-tag_translations-Spodaryk.xml"/>
<include file="db/changelog/logs/ch-delete-from-languages-Spodaryk.xml"/>
<include file="db/changelog/logs/ch-delete-values-employee_authorities-mapping-Spodaryk.xml"/>
</databaseChangeLog>

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>
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'
);

0 comments on commit f5aac1e

Please sign in to comment.