Skip to content

Commit

Permalink
merge ui.seen_sources with merlin.plan_derivation_group
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-super committed Oct 9, 2024
1 parent d01eb0b commit 6ecd248
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,58 @@ select_permissions:
insert_permissions:
- role: aerie_admin
permission:
columns: [plan_id, derivation_group_name]
columns: [plan_id, derivation_group_name, last_acknowledged_at]
check: {}
- role: user
permission:
columns: [plan_id, derivation_group_name]
check: {}
columns: [plan_id, derivation_group_name, last_acknowledged_at]
check: {
"plan": {
"_or": [
{
"owner": { "_eq": "X-Hasura-User-Id" }
},
{
"collaborators": { "collaborator": { "_eq": "X-Hasura-User-Id" } }
}
]
}
}
update_permissions:
- role: aerie_admin
permission:
columns: [plan_id, derivation_group_name]
columns: [ last_acknowledged_at ]
filter: {}
- role: user
permission:
columns: []
filter: {}
columns: [ last_acknowledged_at ]
filter: {
"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: {}
filter: {
"plan": {
"_or": [
{
"owner": { "_eq": "X-Hasura-User-Id" }
},
{
"collaborators": { "collaborator": { "_eq": "X-Hasura-User-Id" } }
}
]
}
}
1 change: 0 additions & 1 deletion deployment/hasura/metadata/databases/tables/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,4 @@
- "!include ui/extension_roles.yaml"
- "!include ui/extensions.yaml"
- "!include ui/view.yaml"
- "!include ui/seen_sources.yaml"
- "!include ui/derivation_group_comp.yaml"
58 changes: 0 additions & 58 deletions deployment/hasura/metadata/databases/tables/ui/seen_sources.yaml

This file was deleted.

1 change: 0 additions & 1 deletion deployment/postgres-init-db/sql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ begin;

-- UI views that depend on Merlin schema
\ir views/ui/derivation_group_comp.sql
\ir tables/ui/seen_sources.sql

-- Scheduling
\ir init_scheduler.sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
create table merlin.plan_derivation_group (
plan_id integer not null,
derivation_group_name text not null,
last_acknowledged_at timestamp with time zone default now() not null,

constraint plan_derivation_group_pkey
primary key (plan_id, derivation_group_name),
Expand All @@ -13,12 +14,15 @@ create table merlin.plan_derivation_group (
);

comment on table merlin.plan_derivation_group is e''
'Links externally imported event sources & plans.';
'Links externally imported event sources & plans.\n'
'Additionally, tracks the last time a plan owner/contributor(s) have acknowledged additions to the derivation group.\n';

comment on column merlin.plan_derivation_group.plan_id is e''
'The plan with which the derivation group is associated.';
comment on column merlin.plan_derivation_group.derivation_group_name is e''
'The derivation group being associated with the plan.';
comment on column merlin.plan_derivation_group.last_acknowledged_at is e''
'The time at which changes to the derivation group were last acknowledged.';

-- if an external source is linked to a plan it cannot be deleted
create function merlin.external_source_pdg_association_delete()
Expand Down
40 changes: 0 additions & 40 deletions deployment/postgres-init-db/sql/tables/ui/seen_sources.sql

This file was deleted.

0 comments on commit 6ecd248

Please sign in to comment.