-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
153 additions
and
6 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
47 changes: 47 additions & 0 deletions
47
...ello-data-superset/src/main/docker/db/changelog/changelogs/07_handle_owners_on_charts.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,47 @@ | ||
-- | ||
-- Copyright © 2024, Kanton Bern | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- * Redistributions of source code must retain the above copyright | ||
-- notice, this list of conditions and the following disclaimer. | ||
-- * Redistributions in binary form must reproduce the above copyright | ||
-- notice, this list of conditions and the following disclaimer in the | ||
-- documentation and/or other materials provided with the distribution. | ||
-- * Neither the name of the <organization> nor the | ||
-- names of its contributors may be used to endorse or promote products | ||
-- derived from this software without specific prior written permission. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
-- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
-- | ||
|
||
-- | ||
-- Adds all current BI_EDITORs as owners of all charts. | ||
-- Deletes potential duplicate entries in the slice_user table. | ||
-- This script is repeatable. | ||
-- | ||
TRUNCATE slice_user RESTART IDENTITY; | ||
|
||
WITH | ||
editor_user_ids AS( | ||
SELECT | ||
user_id | ||
|
||
FROM | ||
ab_user_role | ||
|
||
WHERE | ||
role_id = (SELECT id FROM ab_role WHERE name = 'BI_EDITOR') | ||
) | ||
|
||
INSERT INTO slice_user (id, user_id, slice_id) SELECT nextval('slice_user_id_seq'), editor_user_ids.user_id, slices.id FROM slices, editor_user_ids; |
47 changes: 47 additions & 0 deletions
47
...-data-superset/src/main/docker/db/changelog/changelogs/08_handle_owners_on_dashboards.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,47 @@ | ||
-- | ||
-- Copyright © 2024, Kanton Bern | ||
-- All rights reserved. | ||
-- | ||
-- Redistribution and use in source and binary forms, with or without | ||
-- modification, are permitted provided that the following conditions are met: | ||
-- * Redistributions of source code must retain the above copyright | ||
-- notice, this list of conditions and the following disclaimer. | ||
-- * Redistributions in binary form must reproduce the above copyright | ||
-- notice, this list of conditions and the following disclaimer in the | ||
-- documentation and/or other materials provided with the distribution. | ||
-- * Neither the name of the <organization> nor the | ||
-- names of its contributors may be used to endorse or promote products | ||
-- derived from this software without specific prior written permission. | ||
-- | ||
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
-- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
-- | ||
|
||
-- | ||
-- Adds all current BI_EDITORs as owners of all charts. | ||
-- Deletes potential duplicate entries in the dashboard_user table. | ||
-- This script is repeatable. | ||
-- | ||
TRUNCATE dashboard_user RESTART IDENTITY; | ||
|
||
WITH | ||
editor_user_ids AS( | ||
SELECT | ||
user_id | ||
|
||
FROM | ||
ab_user_role | ||
|
||
WHERE | ||
role_id = (SELECT id FROM ab_role WHERE name = 'BI_EDITOR') | ||
) | ||
|
||
INSERT INTO dashboard_user (id, user_id, dashboard_id) SELECT nextval('dashboard_user_id_seq'), editor_user_ids.user_id, dashboards.id FROM dashboards, editor_user_ids; |
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