-
Notifications
You must be signed in to change notification settings - Fork 19
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 #1147 from NASA-AMMOS/feat/add-snapshot-tags-descr…
…iption Add Snapshot Tags, Description
- Loading branch information
Showing
11 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
deployment/hasura/metadata/databases/AerieMerlin/tables/metadata/plan_snapshot_tags.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,48 @@ | ||
table: | ||
name: plan_snapshot_tags | ||
schema: metadata | ||
configuration: | ||
custom_name: "plan_snapshot_tags" | ||
object_relationships: | ||
- name: plan_snapshot | ||
using: | ||
foreign_key_constraint_on: snapshot_id | ||
- name: tag | ||
using: | ||
foreign_key_constraint_on: tag_id | ||
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: [snapshot_id, tag_id] | ||
check: {} | ||
- role: user | ||
permission: | ||
columns: [snapshot_id, tag_id] | ||
check: {"plan_snapshot":{"plan":{"_or":[ | ||
{"owner":{"_eq":"X-Hasura-User-Id"}}, | ||
{"collaborators":{"collaborator":{"_eq":"X-Hasura-User-Id"}}}]}}} | ||
delete_permissions: | ||
- role: aerie_admin | ||
permission: | ||
filter: {} | ||
- role: user | ||
permission: | ||
filter: {"plan_snapshot":{"plan":{"_or":[ | ||
{"owner":{"_eq":"X-Hasura-User-Id"}}, | ||
{"collaborators":{"collaborator":{"_eq":"X-Hasura-User-Id"}}}]}}} |
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
5 changes: 5 additions & 0 deletions
5
deployment/hasura/migrations/AerieMerlin/27_snapshot_tags_description/down.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,5 @@ | ||
drop table metadata.plan_snapshot_tags; | ||
alter table plan_snapshot drop column description; | ||
alter table plan drop column description; | ||
|
||
call migrations.mark_migration_rolled_back('27'); |
24 changes: 24 additions & 0 deletions
24
deployment/hasura/migrations/AerieMerlin/27_snapshot_tags_description/up.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,24 @@ | ||
alter table plan | ||
add column description text; | ||
comment on column plan.description is e'' | ||
'A human-readable description for this plan and its contents.'; | ||
|
||
alter table plan_snapshot | ||
add column description text; | ||
comment on column plan_snapshot.description is e'' | ||
'A human-readable description of the snapshot and its contents.'; | ||
|
||
create table metadata.plan_snapshot_tags( | ||
snapshot_id integer not null references public.plan_snapshot | ||
on update cascade | ||
on delete cascade, | ||
tag_id integer not null references metadata.tags | ||
on update cascade | ||
on delete cascade, | ||
primary key (snapshot_id, tag_id) | ||
); | ||
comment on table metadata.plan_snapshot_tags is e'' | ||
'The tags associated with a specific. Note: these tags will not be compared in a merge ' | ||
'and will not be applied to the plan if the snapshot is restored.'; | ||
|
||
call migrations.mark_migration_applied('27'); |
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
13 changes: 13 additions & 0 deletions
13
merlin-server/sql/merlin/tables/metadata/plan_snapshot_tags.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,13 @@ | ||
create table metadata.plan_snapshot_tags( | ||
snapshot_id integer not null references public.plan_snapshot | ||
on update cascade | ||
on delete cascade, | ||
tag_id integer not null references metadata.tags | ||
on update cascade | ||
on delete cascade, | ||
primary key (snapshot_id, tag_id) | ||
); | ||
|
||
comment on table metadata.plan_snapshot_tags is e'' | ||
'The tags associated with a specific. Note: these tags will not be compared in a merge ' | ||
'and will not be applied to the plan if the snapshot is restored.'; |
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