Last active
August 2, 2018 05:59
-
-
Save cazzer/657fbfc11af640b1bd882ab9419c256f to your computer and use it in GitHub Desktop.
Table schema for the column version of RLS performant applications.
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
create table if not exists items ( | |
id uuid default uuid_generate_v4() not null primary key, | |
value text, | |
acl_read uuid[] default array[]::uuid[], | |
acl_write uuid[] default array[]::uuid[] | |
); | |
-- e.g. ('f386...5e99', 'I row and therefore I am', {'eac6...f6c9'}, {'0fdc...947f'}) | |
create index read_permissions_index on items using gin(acl_read); | |
create index write_permissions_index on items using gin(acl_write); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment