Skip to content

Commit

Permalink
More PR feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cohansen committed Oct 13, 2023
1 parent 13a141d commit 7ed640e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ node_modules

# Ignore any SQL files copied from build tasks
deployment/postgres-init-db/sql/**/*.sql
!deployment/postgres-init-db/sql/ui/init.sql
!deployment/postgres-init-db/sql/ui/tables/view.sql
!deployment/postgres-init-db/sql/ui/tables/extension_roles.sql
!deployment/postgres-init-db/sql/ui/tables/extensions.sql
!deployment/postgres-init-db/sql/ui/tables/schema_migrations.sql
!deployment/postgres-init-db/sql/ui/applied_migrations.sql
!deployment/postgres-init-db/sql/ui

# Ignore Gradle project-specific cache directory
.gradle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ table:
name: extension_roles
schema: public
object_relationships:
- name: extensions
- name: extension
using:
foreign_key_constraint_on: extension_id
select_permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ insert_permissions:
update_permissions:
- role: aerie_admin
permission:
columns: [description, label, url]
columns: [description, label, owner, url]
filter: {}
delete_permissions:
- role: aerie_admin
Expand Down
7 changes: 4 additions & 3 deletions deployment/hasura/migrations/AerieUI/2_extensions/up.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
create table extensions (
description text,
id integer generated always as identity,
description text,
label text not null,
owner text,
url text not null,
updated_at timestamptz not null default now(),

constraint extension_primary_key primary key (id)
constraint extensions_primary_key primary key (id)
);

comment on table extensions is e''
Expand All @@ -22,7 +22,7 @@ comment on column extensions.url is e''
comment on column extensions.updated_at is e''
'The time the extension was last updated.';

create or replace function extensions_set_updated_at()
create function extensions_set_updated_at()
returns trigger
language plpgsql as $$begin
new.updated_at = now();
Expand All @@ -43,6 +43,7 @@ create table extension_roles (
constraint extension_roles_to_extension
foreign key (extension_id)
references "extensions"
on update cascade
on delete cascade
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ create table extension_roles (
constraint extension_roles_to_extension
foreign key (extension_id)
references "extensions"
on update cascade
on delete cascade
);

Expand Down
6 changes: 3 additions & 3 deletions deployment/postgres-init-db/sql/ui/tables/extensions.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
create table extensions (
description text,
id integer generated always as identity,
description text,
label text not null,
owner text,
url text not null,
updated_at timestamptz not null default now(),

constraint extension_primary_key primary key (id)
constraint extensions_primary_key primary key (id)
);

comment on table extensions is e''
Expand All @@ -22,7 +22,7 @@ comment on column extensions.url is e''
comment on column extensions.updated_at is e''
'The time the extension was last updated.';

create or replace function extensions_set_updated_at()
create function extensions_set_updated_at()
returns trigger
language plpgsql as $$begin
new.updated_at = now();
Expand Down

0 comments on commit 7ed640e

Please sign in to comment.