-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: splits mysql init into two steps
because we can't grant table-specific permissions for tables that do not exist yet. Step 1: unchanged Step 2: Grants SELECT access to superset metadata tables created by Superset migrations
- Loading branch information
1 parent
9ad42bf
commit ba89145
Showing
3 changed files
with
11 additions
and
14 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
6 changes: 6 additions & 0 deletions
6
tutoraspects/templates/aspects/jobs/init/mysql/init-mysql-post-migration.sh
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,6 @@ | ||
echo "MySQL init after Superset migrations..." | ||
|
||
# Grant SELECT access to a subset of superset metadata tables | ||
for TABLE in ab_user dashboards logs slices tables; do | ||
mysql -u {{ MYSQL_ROOT_USERNAME }} --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e "GRANT SELECT ON {{ SUPERSET_DB_METADATA_NAME }}.${TABLE} TO '{{ SUPERSET_DB_USERNAME }}'@'%';" | ||
done |
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