Hasura V2 upgrade.
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
version: 2
|
||||
endpoint: https://rps.bodyshop.app
|
||||
admin_secret: ImEXRPSDataBase
|
||||
admin_secret: ImEXRPSDataBase
|
||||
metadata_directory: metadata
|
||||
actions:
|
||||
kind: synchronous
|
||||
handler_webhook_baseurl: http://localhost:3000
|
||||
|
||||
0
hasura/metadata/actions.graphql
Normal file
0
hasura/metadata/actions.graphql
Normal file
6
hasura/metadata/actions.yaml
Normal file
6
hasura/metadata/actions.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
actions: []
|
||||
custom_types:
|
||||
enums: []
|
||||
input_objects: []
|
||||
objects: []
|
||||
scalars: []
|
||||
1
hasura/metadata/allow_list.yaml
Normal file
1
hasura/metadata/allow_list.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
1
hasura/metadata/cron_triggers.yaml
Normal file
1
hasura/metadata/cron_triggers.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
3
hasura/metadata/functions.yaml
Normal file
3
hasura/metadata/functions.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
- function:
|
||||
name: search_jobs
|
||||
schema: public
|
||||
1
hasura/metadata/network.yaml
Normal file
1
hasura/metadata/network.yaml
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
1
hasura/metadata/query_collections.yaml
Normal file
1
hasura/metadata/query_collections.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
1
hasura/metadata/remote_schemas.yaml
Normal file
1
hasura/metadata/remote_schemas.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
365
hasura/metadata/tables.yaml
Normal file
365
hasura/metadata/tables.yaml
Normal file
@@ -0,0 +1,365 @@
|
||||
- table:
|
||||
name: associations
|
||||
schema: public
|
||||
object_relationships:
|
||||
- name: bodyshop
|
||||
using:
|
||||
foreign_key_constraint_on: bodyshopid
|
||||
- name: user
|
||||
using:
|
||||
foreign_key_constraint_on: email
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- email
|
||||
- id
|
||||
filter:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
array_relationships:
|
||||
- name: associations
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: bodyshopid
|
||||
table:
|
||||
name: associations
|
||||
schema: public
|
||||
- name: jobs
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: bodyshopid
|
||||
table:
|
||||
name: jobs
|
||||
schema: public
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- created_at
|
||||
- groups
|
||||
- id
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
update_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- groups
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
check: null
|
||||
- table:
|
||||
name: groupings
|
||||
schema: public
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- effective_date
|
||||
- end_date
|
||||
- make
|
||||
- group
|
||||
- type
|
||||
filter: {}
|
||||
- table:
|
||||
name: joblines
|
||||
schema: public
|
||||
object_relationships:
|
||||
- name: job
|
||||
using:
|
||||
foreign_key_constraint_on: jobid
|
||||
insert_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
check:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- ignore
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- ignore
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
update_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- act_price
|
||||
- created_at
|
||||
- db_price
|
||||
- db_ref
|
||||
- id
|
||||
- ignore
|
||||
- jobid
|
||||
- line_desc
|
||||
- line_ind
|
||||
- line_no
|
||||
- oem_partno
|
||||
- part_qty
|
||||
- part_type
|
||||
- price_diff
|
||||
- price_diff_pc
|
||||
- unq_seq
|
||||
- updated_at
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
check: null
|
||||
delete_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
backend_only: false
|
||||
filter:
|
||||
job:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- table:
|
||||
name: jobs
|
||||
schema: public
|
||||
object_relationships:
|
||||
- name: bodyshop
|
||||
using:
|
||||
foreign_key_constraint_on: bodyshopid
|
||||
array_relationships:
|
||||
- name: joblines
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: jobid
|
||||
table:
|
||||
name: joblines
|
||||
schema: public
|
||||
insert_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- close_date
|
||||
- created_at
|
||||
- group
|
||||
- group_verified
|
||||
- id
|
||||
- ins_co_nm
|
||||
- loss_date
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- close_date
|
||||
- created_at
|
||||
- group
|
||||
- group_verified
|
||||
- id
|
||||
- ins_co_nm
|
||||
- loss_date
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
allow_aggregations: true
|
||||
update_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- bodyshopid
|
||||
- clm_no
|
||||
- clm_total
|
||||
- close_date
|
||||
- created_at
|
||||
- group
|
||||
- group_verified
|
||||
- id
|
||||
- ins_co_nm
|
||||
- loss_date
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ro_number
|
||||
- updated_at
|
||||
- v_age
|
||||
- v_makedesc
|
||||
- v_mileage
|
||||
- v_model
|
||||
- v_model_yr
|
||||
- v_type
|
||||
- v_vin
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
check: null
|
||||
delete_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
backend_only: false
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- table:
|
||||
name: users
|
||||
schema: public
|
||||
array_relationships:
|
||||
- name: associations
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: email
|
||||
table:
|
||||
name: associations
|
||||
schema: public
|
||||
insert_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
check: {}
|
||||
columns:
|
||||
- email
|
||||
- authid
|
||||
- created_at
|
||||
- updated_at
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- authid
|
||||
- created_at
|
||||
- email
|
||||
- id
|
||||
- updated_at
|
||||
filter:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
update_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- authid
|
||||
filter:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
check: null
|
||||
- table:
|
||||
name: veh_groups
|
||||
schema: public
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- make
|
||||
- type
|
||||
- group
|
||||
filter: {}
|
||||
1
hasura/metadata/version.yaml
Normal file
1
hasura/metadata/version.yaml
Normal file
@@ -0,0 +1 @@
|
||||
version: 2
|
||||
2
hasura/migrations/1602633863978_create_table_public_users/down.sql
Executable file
2
hasura/migrations/1602633863978_create_table_public_users/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."users";
|
||||
18
hasura/migrations/1602633863978_create_table_public_users/up.sql
Executable file
18
hasura/migrations/1602633863978_create_table_public_users/up.sql
Executable file
@@ -0,0 +1,18 @@
|
||||
|
||||
CREATE TABLE "public"."users"("email" text NOT NULL, "authid" text NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("email") );
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_users_updated_at"
|
||||
BEFORE UPDATE ON "public"."users"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_users_updated_at" ON "public"."users"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
2
hasura/migrations/1602634004830_create_table_public_bodyshops/down.sql
Executable file
2
hasura/migrations/1602634004830_create_table_public_bodyshops/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."bodyshops";
|
||||
19
hasura/migrations/1602634004830_create_table_public_bodyshops/up.sql
Executable file
19
hasura/migrations/1602634004830_create_table_public_bodyshops/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."bodyshops"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "shopname" text NOT NULL, PRIMARY KEY ("id") );
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_bodyshops_updated_at"
|
||||
BEFORE UPDATE ON "public"."bodyshops"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_bodyshops_updated_at" ON "public"."bodyshops"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."associations";
|
||||
2
hasura/migrations/1602634062624_create_table_public_associations/up.sql
Executable file
2
hasura/migrations/1602634062624_create_table_public_associations/up.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
CREATE TABLE "public"."associations"("email" text NOT NULL, "bodyshopid" uuid NOT NULL, PRIMARY KEY ("email","bodyshopid") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("email") REFERENCES "public"."users"("email") ON UPDATE cascade ON DELETE cascade);
|
||||
2
hasura/migrations/1602634310021_create_table_public_jobs/down.sql
Executable file
2
hasura/migrations/1602634310021_create_table_public_jobs/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."jobs";
|
||||
19
hasura/migrations/1602634310021_create_table_public_jobs/up.sql
Executable file
19
hasura/migrations/1602634310021_create_table_public_jobs/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."jobs"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "bodyshopid" uuid NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "ro_number" text, "ins_co_nm" text, "clm_no" text, "clm_total" numeric, "ownr_ln" text, "ownr_fn" text, "v_vin" text, "v_make_desc" text, "v_model_desc" text, "v_model_yr" text, "v_type" text, PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade);
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_jobs_updated_at"
|
||||
BEFORE UPDATE ON "public"."jobs"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_jobs_updated_at" ON "public"."jobs"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
2
hasura/migrations/1602634492124_create_table_public_joblines/down.sql
Executable file
2
hasura/migrations/1602634492124_create_table_public_joblines/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."joblines";
|
||||
19
hasura/migrations/1602634492124_create_table_public_joblines/up.sql
Executable file
19
hasura/migrations/1602634492124_create_table_public_joblines/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."joblines"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "jobid" uuid NOT NULL, "unq_seq" text, "line_ind" text, "line_desc" text, "part_type" text, "oem_partno" text, "db_price" numeric, "act_price" numeric, "part_qty" numeric, PRIMARY KEY ("id") , FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade);
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_joblines_updated_at"
|
||||
BEFORE UPDATE ON "public"."joblines"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_joblines_updated_at" ON "public"."joblines"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" drop constraint "jobs_clm_no_bodyshopid_key";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" add constraint "jobs_clm_no_bodyshopid_key" unique ("clm_no", "bodyshopid");
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "v_model" to "v_model_desc";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "v_model_desc" to "v_model";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "v_makedesc" to "v_make_desc";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "v_make_desc" to "v_makedesc";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" DROP COLUMN "db_ref";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" ADD COLUMN "db_ref" text NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" DROP COLUMN "line_no";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" ADD COLUMN "line_no" numeric NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "group";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "group" text NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "v_mileage";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "v_mileage" numeric NULL;
|
||||
2
hasura/migrations/1602870360794_create_table_public_veh_groups/down.sql
Executable file
2
hasura/migrations/1602870360794_create_table_public_veh_groups/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."veh_groups";
|
||||
19
hasura/migrations/1602870360794_create_table_public_veh_groups/up.sql
Executable file
19
hasura/migrations/1602870360794_create_table_public_veh_groups/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."veh_groups"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "make" text NOT NULL, "type" text NOT NULL, "group" text NOT NULL, PRIMARY KEY ("id") );
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_veh_groups_updated_at"
|
||||
BEFORE UPDATE ON "public"."veh_groups"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_veh_groups_updated_at" ON "public"."veh_groups"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."veh_groups" ALTER COLUMN "type" SET NOT NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."veh_groups" ALTER COLUMN "type" DROP NOT NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "v_age";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "v_age" numeric NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "asgn_date";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "asgn_date" date NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "loss_date" to "asgn_date";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."jobs" rename column "asgn_date" to "loss_date";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" DROP COLUMN "price_diff";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" ADD COLUMN "price_diff" numeric NULL;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" DROP COLUMN "price_diff_pc";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" ADD COLUMN "price_diff_pc" numeric NULL;
|
||||
16
hasura/migrations/1602875306082_run_sql_migration/up.sql
Executable file
16
hasura/migrations/1602875306082_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,16 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.calculate_job_line()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."price_diff" = _new."db_price" - _new."act_price";
|
||||
_new."price_diff_pc" = (_new."db_price" - _new."act_price") / _new."db_price";
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$function$
|
||||
;
|
||||
20
hasura/migrations/1602875452605_run_sql_migration/up.sql
Executable file
20
hasura/migrations/1602875452605_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,20 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.calculate_job_line()
|
||||
RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."price_diff" = _new."db_price" - _new."act_price";
|
||||
|
||||
if _new."db_price" > 0 then
|
||||
_new."price_diff_pc" = (_new."db_price" - _new."act_price") / _new."db_price";
|
||||
|
||||
end if;
|
||||
|
||||
RETURN _new;
|
||||
END;
|
||||
$function$
|
||||
;
|
||||
5
hasura/migrations/1602875615937_run_sql_migration/up.sql
Executable file
5
hasura/migrations/1602875615937_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,5 @@
|
||||
|
||||
create trigger calculate_updated_job_line before
|
||||
update
|
||||
on
|
||||
public.joblines for each row execute procedure calculate_job_line();
|
||||
2
hasura/migrations/1602881581659_create_table_public_targets/down.sql
Executable file
2
hasura/migrations/1602881581659_create_table_public_targets/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."targets";
|
||||
19
hasura/migrations/1602881581659_create_table_public_targets/up.sql
Executable file
19
hasura/migrations/1602881581659_create_table_public_targets/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."targets"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "updated_at" timestamptz NOT NULL DEFAULT now(), "created_at" timestamptz NOT NULL DEFAULT now(), "label" text NOT NULL, "config" jsonb NOT NULL DEFAULT jsonb_build_object(), "start_date" date NOT NULL, "end_date" date, PRIMARY KEY ("id") );
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_targets_updated_at"
|
||||
BEFORE UPDATE ON "public"."targets"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_targets_updated_at" ON "public"."targets"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
2
hasura/migrations/1602881684708_drop_table_public_targets/up.sql
Executable file
2
hasura/migrations/1602881684708_drop_table_public_targets/up.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."targets";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" DROP COLUMN "targets";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" ADD COLUMN "targets" jsonb NULL DEFAULT jsonb_build_object();
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" DROP COLUMN "accepted_ins_co";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" ADD COLUMN "accepted_ins_co" jsonb NULL DEFAULT jsonb_build_array();
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "close_date";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "close_date" date NULL;
|
||||
25
hasura/migrations/1603135634854_run_sql_migration/up.sql
Executable file
25
hasura/migrations/1603135634854_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,25 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
end if;
|
||||
END $function$;
|
||||
2
hasura/migrations/1603135748604_run_sql_migration/up.sql
Executable file
2
hasura/migrations/1603135748604_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
drop FUNCTION public.search_jobs;
|
||||
25
hasura/migrations/1603135755518_run_sql_migration/up.sql
Executable file
25
hasura/migrations/1603135755518_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,25 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startDate date, endDate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
end if;
|
||||
END $function$;
|
||||
28
hasura/migrations/1603135821609_run_sql_migration/up.sql
Executable file
28
hasura/migrations/1603135821609_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,28 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startDate date, endDate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
end if;
|
||||
END $function$;
|
||||
52
hasura/migrations/1603135880002_run_sql_migration/up.sql
Executable file
52
hasura/migrations/1603135880002_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,52 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startDate date, endDate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else
|
||||
|
||||
if startDate is null || endDate is null then
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
else
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
|
||||
end if;
|
||||
|
||||
|
||||
end if;
|
||||
END $function$;
|
||||
52
hasura/migrations/1603135999901_run_sql_migration/up.sql
Executable file
52
hasura/migrations/1603135999901_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,52 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startdate date, enddate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else
|
||||
|
||||
if (startDate is null) || (endDate is null) then
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
else
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
|
||||
end if;
|
||||
|
||||
|
||||
end if;
|
||||
END $function$;
|
||||
52
hasura/migrations/1603136020110_run_sql_migration/up.sql
Executable file
52
hasura/migrations/1603136020110_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,52 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startdate date, enddate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else
|
||||
|
||||
if (startDate is null) or (endDate is null) then
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
else
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
|
||||
end if;
|
||||
|
||||
|
||||
end if;
|
||||
END $function$;
|
||||
52
hasura/migrations/1603204459690_run_sql_migration/up.sql
Executable file
52
hasura/migrations/1603204459690_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,52 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startdate date, enddate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$ BEGIN if search = '' then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else
|
||||
|
||||
if (startDate is null) or (endDate is null) then
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
else
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and close_date is not null and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
|
||||
end if;
|
||||
|
||||
|
||||
end if;
|
||||
END $function$;
|
||||
53
hasura/migrations/1603204604474_run_sql_migration/up.sql
Executable file
53
hasura/migrations/1603204604474_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,53 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION public.search_jobs(search text, startdate date, enddate date)
|
||||
RETURNS SETOF jobs
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$
|
||||
BEGIN if search = '' and ((startDate is null) or (endDate is null)) then return query
|
||||
select *
|
||||
from jobs j;
|
||||
else
|
||||
|
||||
if (startDate is null) or (endDate is null) then
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%'
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
else
|
||||
return query
|
||||
SELECT *
|
||||
FROM jobs j2
|
||||
WHERE
|
||||
close_date between startDate and endDate and close_date is not null and
|
||||
(
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
or ownr_ln ILIKE '%' || search || '%'
|
||||
|
||||
or clm_no ILIKE '%' || search || '%')
|
||||
|
||||
ORDER BY
|
||||
clm_no ILIKE '%' || search || '%'
|
||||
OR null,
|
||||
ownr_fn ILIKE '%' || search || '%'
|
||||
OR NULL,
|
||||
ownr_ln ILIKE '%' || search || '%'
|
||||
OR NULL;
|
||||
|
||||
end if;
|
||||
|
||||
|
||||
end if;
|
||||
END $function$;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" DROP COLUMN "ignore";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."joblines" ADD COLUMN "ignore" boolean NOT NULL DEFAULT false;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" DROP COLUMN "groups";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" ADD COLUMN "groups" jsonb NOT NULL DEFAULT jsonb_build_array();
|
||||
6
hasura/migrations/1603740763642_run_sql_migration/up.sql
Executable file
6
hasura/migrations/1603740763642_run_sql_migration/up.sql
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
create trigger calculate_updated_job_line_insert
|
||||
before
|
||||
insert
|
||||
on
|
||||
public.joblines for each row execute function calculate_job_line();
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" DROP COLUMN "ppd_diff_alert";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."bodyshops" ADD COLUMN "ppd_diff_alert" numeric NULL DEFAULT .05;
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
alter table "public"."associations"
|
||||
add constraint "associations_pkey"
|
||||
primary key ( "bodyshopid", "email" );
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."associations" drop constraint "associations_pkey";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."associations" DROP COLUMN "id";
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
ALTER TABLE "public"."associations" ADD COLUMN "id" uuid NULL UNIQUE DEFAULT gen_random_uuid();
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
alter table "public"."associations" drop constraint "associations_pkey";
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
alter table "public"."associations"
|
||||
add constraint "associations_pkey"
|
||||
primary key ( "id" );
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."users" DROP COLUMN "id";
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
ALTER TABLE "public"."users" ADD COLUMN "id" uuid NULL UNIQUE DEFAULT gen_random_uuid();
|
||||
2
hasura/migrations/1613584484158_create_table_public_groupings/down.sql
Executable file
2
hasura/migrations/1613584484158_create_table_public_groupings/down.sql
Executable file
@@ -0,0 +1,2 @@
|
||||
|
||||
DROP TABLE "public"."groupings";
|
||||
19
hasura/migrations/1613584484158_create_table_public_groupings/up.sql
Executable file
19
hasura/migrations/1613584484158_create_table_public_groupings/up.sql
Executable file
@@ -0,0 +1,19 @@
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TABLE "public"."groupings"("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "effective_date" date NOT NULL, "end_date" date, "make" text NOT NULL, "group" text NOT NULL, "type" jsonb NOT NULL DEFAULT jsonb_build_array(), PRIMARY KEY ("id") );
|
||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||
RETURNS TRIGGER AS $$
|
||||
DECLARE
|
||||
_new record;
|
||||
BEGIN
|
||||
_new := NEW;
|
||||
_new."updated_at" = NOW();
|
||||
RETURN _new;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER "set_public_groupings_updated_at"
|
||||
BEFORE UPDATE ON "public"."groupings"
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||
COMMENT ON TRIGGER "set_public_groupings_updated_at" ON "public"."groupings"
|
||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE ONLY "public"."groupings" ALTER COLUMN "effective_date" DROP DEFAULT;
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE ONLY "public"."groupings" ALTER COLUMN "effective_date" SET DEFAULT now();
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" DROP COLUMN "group_verified";
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
ALTER TABLE "public"."jobs" ADD COLUMN "group_verified" boolean NOT NULL DEFAULT false;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user