Skip to content

Commit

Permalink
reformated solution to migrate db with prisma
Browse files Browse the repository at this point in the history
  • Loading branch information
joelazwar committed Apr 9, 2022
1 parent cdebde4 commit ecee7cf
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 76 deletions.
66 changes: 0 additions & 66 deletions docker/supabase/volumes/db/init/05-github-schema.sql

This file was deleted.

10 changes: 0 additions & 10 deletions src/db/prisma/migrations/20220406234157_enable_rls/migration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,3 @@ CREATE POLICY feeds_read_policy ON feeds
FOR SELECT
USING (true);

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)

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)

0 comments on commit ecee7cf

Please sign in to comment.