-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reformated solution to migrate db with prisma
- Loading branch information
Showing
3 changed files
with
41 additions
and
76 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
41 changes: 41 additions & 0 deletions
41
src/db/prisma/migrations/20220409140003_add_rls_policy_new_tables/migration.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,41 @@ | ||
-- Add Read level access to all users, and restrict all other access for the quotes, and github tables | ||
|
||
ALTER TABLE quotes ENABLE ROW LEVEL SECURITY; | ||
|
||
CREATE POLICY quotes_policy ON quotes | ||
FOR ALL | ||
USING (false); | ||
|
||
CREATE POLICY quotes_read_policy ON quotes | ||
FOR SELECT | ||
USING (true) | ||
|
||
ALTER TABLE github_issues ENABLE ROW LEVEL SECURITY; | ||
|
||
CREATE POLICY github_issues_policy ON github_issues | ||
FOR ALL | ||
USING (false); | ||
|
||
CREATE POLICY github_issues_read_policy ON github_issues | ||
FOR SELECT | ||
USING (true) | ||
|
||
ALTER TABLE github_repositories ENABLE ROW LEVEL SECURITY; | ||
|
||
CREATE POLICY github_repositories_policy ON github_repositories | ||
FOR ALL | ||
USING (false); | ||
|
||
CREATE POLICY github_repositories_read_policy ON github_repositories | ||
FOR SELECT | ||
USING (true) | ||
|
||
ALTER TABLE github_users ENABLE ROW LEVEL SECURITY; | ||
|
||
CREATE POLICY github_users_policy ON github_users | ||
FOR ALL | ||
USING (false); | ||
|
||
CREATE POLICY github_users_read_policy ON github_users | ||
FOR SELECT | ||
USING (true) |