feature/IO-3182-Phone-Number-Consent - Finish Database changes

This commit is contained in:
Dave Richer
2025-05-20 12:49:32 -04:00
parent 6ad9e27d1d
commit 985d066978
3 changed files with 40 additions and 0 deletions

View File

@@ -5870,6 +5870,14 @@
- name: bodyshop
using:
foreign_key_constraint_on: bodyshopid
array_relationships:
- name: phone_number_consent_histories
using:
foreign_key_constraint_on:
column: phone_number_consent_id
table:
name: phone_number_consent_history
schema: public
insert_permissions:
- role: user
permission:
@@ -5925,6 +5933,35 @@
filter: {}
check: null
comment: ""
- table:
name: phone_number_consent_history
schema: public
object_relationships:
- name: phone_number_consent
using:
foreign_key_constraint_on: phone_number_consent_id
select_permissions:
- role: user
permission:
columns:
- new_value
- old_value
- changed_by
- reason
- changed_at
- id
- phone_number_consent_id
filter:
phone_number_consent:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
comment: ""
- table:
name: phonebook
schema: public

View File

@@ -0,0 +1 @@
DROP TABLE "public"."phone_number_consent_history";

View File

@@ -0,0 +1,2 @@
CREATE TABLE "public"."phone_number_consent_history" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "phone_number_consent_id" uuid NOT NULL, "old_value" boolean NOT NULL, "new_value" boolean NOT NULL, "reason" text NOT NULL, "changed_at" timestamptz NOT NULL DEFAULT now(), "changed_by" text NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("phone_number_consent_id") REFERENCES "public"."phone_number_consent"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"));
CREATE EXTENSION IF NOT EXISTS pgcrypto;