-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously was in local storage, but wouldn't clear correctly on DB reset.
- Loading branch information
1 parent
c2afd3d
commit 219076f
Showing
6 changed files
with
100 additions
and
0 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
35 changes: 35 additions & 0 deletions
35
deployment/hasura/metadata/databases/tables/ui/seen_sources.yaml
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,35 @@ | ||
table: | ||
name: seen_sources | ||
schema: ui | ||
configuration: | ||
custom_name: "seen_sources" | ||
select_permissions: | ||
- role: aerie_admin | ||
permission: | ||
columns: '*' | ||
filter: {} | ||
allow_aggregations: true | ||
- role: user | ||
permission: | ||
columns: '*' | ||
filter: {} | ||
allow_aggregations: true | ||
- role: viewer | ||
permission: | ||
columns: '*' | ||
filter: {} | ||
allow_aggregations: true | ||
insert_permissions: | ||
- role: aerie_admin | ||
permission: | ||
columns: '*' | ||
check: {} | ||
update_permissions: | ||
- role: aerie_admin | ||
permission: | ||
columns: '*' | ||
filter: {} | ||
delete_permissions: | ||
- role: aerie_admin | ||
permission: | ||
filter: {} |
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
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
29 changes: 29 additions & 0 deletions
29
deployment/postgres-init-db/sql/tables/ui/seen_sources.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,29 @@ | ||
-- Create a table to track which sources the user has and has not seen added/removed | ||
CREATE TABLE ui.seen_sources | ||
( | ||
id integer NOT NULL, | ||
"user" text NOT NULL, | ||
external_source_name text NOT NULL, | ||
external_source_type text NOT NULL, | ||
derivation_group text NOT NULL, | ||
CONSTRAINT "user -> users.username" FOREIGN KEY ("user") | ||
REFERENCES permissions.users (username) MATCH SIMPLE | ||
ON UPDATE NO ACTION | ||
ON DELETE NO ACTION | ||
); | ||
|
||
-- Ensure the id is serial | ||
CREATE SEQUENCE ui.seen_sources_id_seq | ||
AS integer | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
ALTER SEQUENCE ui.seen_sources_id_seq OWNED BY ui.seen_sources.id; | ||
ALTER TABLE ONLY ui.seen_sources ALTER COLUMN id SET DEFAULT nextval('ui.seen_sources_id_seq'::regclass); | ||
|
||
-- Set primary key | ||
ALTER TABLE ONLY ui.seen_sources | ||
ADD CONSTRAINT seen_sources_pkey PRIMARY KEY (id); |