-
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.
- add description column - add association table "plan_snapshot_tags"
- Loading branch information
1 parent
b050479
commit a52dd6b
Showing
8 changed files
with
112 additions
and
0 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
2 changes: 2 additions & 0 deletions
2
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 |
---|---|---|
@@ -1,3 +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'); |
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