-
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.
Merge pull request #250 from NASA-AMMOS/feat/add-hasrua-ui-view-db
[AERIE-1946] feat: add UI database to Hasura
- Loading branch information
Showing
11 changed files
with
65 additions
and
38 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
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
3 changes: 3 additions & 0 deletions
3
deployment/hasura/metadata/databases/AerieUI/tables/public_view.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,3 @@ | ||
table: | ||
name: view | ||
schema: public |
1 change: 1 addition & 0 deletions
1
deployment/hasura/metadata/databases/AerieUI/tables/tables.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 @@ | ||
- "!include public_view.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
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
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 |
---|---|---|
@@ -1,3 +1,38 @@ | ||
create table view ( | ||
view jsonb not null | ||
created_at timestamptz not null default now(), | ||
definition jsonb not null, | ||
id integer generated always as identity, | ||
name text not null, | ||
owner text not null default 'system', | ||
updated_at timestamptz not null default now(), | ||
|
||
constraint view_primary_key primary key (id) | ||
); | ||
|
||
comment on table view is e'' | ||
'View configuration for Aerie UI.'; | ||
comment on column view.created_at is e'' | ||
'Time the view was created.'; | ||
comment on column view.definition is e'' | ||
'JSON blob of the view definition that implements the view JSON schema.'; | ||
comment on column view.id is e'' | ||
'Integer primary key of the view.'; | ||
comment on column view.name is e'' | ||
'Human-readable name of the view.'; | ||
comment on column view.owner is e'' | ||
'Username of the view owner.'; | ||
comment on column view.updated_at is e'' | ||
'Time the view was last updated.'; | ||
|
||
create or replace function view_set_updated_at() | ||
returns trigger | ||
security definer | ||
language plpgsql as $$begin | ||
new.updated_at = now(); | ||
return new; | ||
end$$; | ||
|
||
create trigger set_timestamp | ||
before update on view | ||
for each row | ||
execute function view_set_updated_at(); |
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