Hasura migration changes to change assigned_to to uuid not email.

This commit is contained in:
Patrick Fic
2024-04-19 08:10:45 -07:00
parent 0b9f718106
commit fb322f760f
13 changed files with 57 additions and 24 deletions

View File

@@ -5684,6 +5684,9 @@
- name: bodyshop
using:
foreign_key_constraint_on: bodyshopid
- name: employee
using:
foreign_key_constraint_on: assigned_to
- name: job
using:
foreign_key_constraint_on: jobid
@@ -5693,9 +5696,6 @@
- name: parts_order
using:
foreign_key_constraint_on: partsorderid
- name: user
using:
foreign_key_constraint_on: assigned_to
- name: userByCreatedBy
using:
foreign_key_constraint_on: created_by
@@ -5736,25 +5736,25 @@
- role: user
permission:
columns:
- completed
- deleted
- priority
- assigned_to
- created_by
- description
- title
- completed_at
- created_at
- deleted_at
- due_date
- remind_at
- updated_at
- billid
- bodyshopid
- completed
- completed_at
- created_at
- created_by
- deleted
- deleted_at
- description
- due_date
- id
- jobid
- joblineid
- partsorderid
- priority
- remind_at
- remind_at_sent
- title
- updated_at
filter:
bodyshop:
associations:
@@ -5807,7 +5807,7 @@
columns: '*'
update:
columns:
- assigned_to
- bodyshopid
retry_conf:
interval_sec: 10
num_retries: 3
@@ -6191,6 +6191,13 @@
table:
name: email_audit_trail
schema: public
- name: employees
using:
foreign_key_constraint_on:
column: user_email
table:
name: employees
schema: public
- name: eula_acceptances
using:
foreign_key_constraint_on:
@@ -6240,13 +6247,6 @@
table:
name: parts_orders
schema: public
- name: tasks
using:
foreign_key_constraint_on:
column: assigned_to
table:
name: tasks
schema: public
- name: tasksByCreatedBy
using:
foreign_key_constraint_on:

View File

@@ -0,0 +1 @@
alter table "public"."tasks" drop constraint "tasks_created_by_fkey2";

View File

@@ -0,0 +1,5 @@
alter table "public"."tasks"
add constraint "tasks_created_by_fkey2"
foreign key ("created_by")
references "public"."users"
("email") on update restrict on delete restrict;

View File

@@ -0,0 +1,5 @@
alter table "public"."tasks"
add constraint "tasks_created_by_fkey2"
foreign key ("created_by")
references "public"."users"
("email") on update restrict on delete restrict;

View File

@@ -0,0 +1 @@
alter table "public"."tasks" drop constraint "tasks_created_by_fkey2";

View File

@@ -0,0 +1,5 @@
alter table "public"."tasks"
add constraint "tasks_assigned_to_fkey"
foreign key ("assigned_to")
references "public"."users"
("email") on update restrict on delete restrict;

View File

@@ -0,0 +1 @@
alter table "public"."tasks" drop constraint "tasks_assigned_to_fkey";

View File

@@ -0,0 +1,2 @@
alter table "public"."tasks" alter column "assigned_to" drop not null;
alter table "public"."tasks" add column "assigned_to" text;

View File

@@ -0,0 +1 @@
alter table "public"."tasks" drop column "assigned_to" cascade;

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."tasks" add column "assigned_to" uuid
-- null;

View File

@@ -0,0 +1,2 @@
alter table "public"."tasks" add column "assigned_to" uuid
null;

View File

@@ -0,0 +1 @@
alter table "public"."tasks" drop constraint "tasks_assigned_to_fkey";

View File

@@ -0,0 +1,5 @@
alter table "public"."tasks"
add constraint "tasks_assigned_to_fkey"
foreign key ("assigned_to")
references "public"."employees"
("id") on update restrict on delete restrict;