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