Skip to content

Commit

Permalink
feat(map): adds hasura configuration layers and features
Browse files Browse the repository at this point in the history
  • Loading branch information
nimdanitro committed Jan 31, 2024
1 parent bdca12b commit 11547ee
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 0 deletions.
52 changes: 52 additions & 0 deletions metadata/databases/Postgres/tables/public_features.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
table:
name: features
schema: public
object_relationships:
- name: layer
using:
foreign_key_constraint_on: layer_id
insert_permissions:
- role: editor
permission:
check: {}
columns:
- created_at
- geometry
- id
- layer_id
- properties
select_permissions:
- role: editor
permission:
columns:
- created_at
- deleted_at
- geometry
- id
- layer_id
- properties
- updated_at
filter: {}
- role: viewer
permission:
columns:
- created_at
- deleted_at
- geometry
- id
- layer_id
- properties
- updated_at
filter: {}
update_permissions:
- role: editor
permission:
columns:
- created_at
- deleted_at
- geometry
- id
- properties
- updated_at
filter: {}
check: null
7 changes: 7 additions & 0 deletions metadata/databases/Postgres/tables/public_incidents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ array_relationships:
table:
name: journals
schema: public
- name: layers
using:
foreign_key_constraint_on:
column: incident_id
table:
name: layers
schema: public
insert_permissions:
- role: editor
permission:
Expand Down
42 changes: 42 additions & 0 deletions metadata/databases/Postgres/tables/public_layers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
table:
name: layers
schema: public
object_relationships:
- name: incident
using:
foreign_key_constraint_on: incident_id
array_relationships:
- name: features
using:
foreign_key_constraint_on:
column: layer_id
table:
name: features
schema: public
insert_permissions:
- role: editor
permission:
check: {}
columns:
- incident_id
- name
select_permissions:
- role: editor
permission:
columns:
- id
- name
filter: {}
- role: viewer
permission:
columns:
- id
- name
filter: {}
update_permissions:
- role: editor
permission:
columns:
- name
filter: {}
check: null
2 changes: 2 additions & 0 deletions metadata/databases/Postgres/tables/tables.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
- "!include public_divisions.yaml"
- "!include public_features.yaml"
- "!include public_incidents.yaml"
- "!include public_journals.yaml"
- "!include public_layers.yaml"
- "!include public_locations.yaml"
- "!include public_medium.yaml"
- "!include public_message_division.yaml"
Expand Down
1 change: 1 addition & 0 deletions metadata/opentelemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."layers";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."layers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "incident" uuid NOT NULL, "name" text NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("incident") REFERENCES "public"."incidents"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"));
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."features";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE "public"."features" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "layer_id" uuid NOT NULL, "properties" jsonb NOT NULL, "geometry" jsonb NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id") , FOREIGN KEY ("layer_id") REFERENCES "public"."layers"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"));COMMENT ON TABLE "public"."features" IS E'Features GeoJSON';
CREATE EXTENSION IF NOT EXISTS pgcrypto;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."layers" rename column "incident_id" to "incident";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."layers" rename column "incident" to "incident_id";

0 comments on commit 11547ee

Please sign in to comment.