Added job list container. Removed all previous migrations.

This commit is contained in:
Patrick Fic
2019-12-06 09:26:50 -08:00
parent f875e9611b
commit ab1e4d5424
85 changed files with 104 additions and 1088 deletions

View File

@@ -1,18 +0,0 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"users\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
\"username\" text NOT NULL, \"password\" text NOT NULL, \"created_at\" timestamptz
NOT NULL DEFAULT now(), \"updated_at\" timestamptz NOT NULL DEFAULT now(), \"last_login\"
timestamptz, PRIMARY KEY (\"id\") );\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_users_updated_at\"\nBEFORE
UPDATE ON \"public\".\"users\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_users_updated_at\" ON \"public\".\"users\" \nIS 'trigger
to set value of column \"updated_at\" to current timestamp on row update';\n"
type: run_sql
- args:
name: users
schema: public
type: add_existing_table_or_view

View File

@@ -1,18 +0,0 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"bodyshops\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
\"shop_name\" text NOT NULL, \"created_at\" timestamptz NOT NULL DEFAULT now(),
\"updated_at\" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (\"id\") );\nCREATE
OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_bodyshops_updated_at\"\nBEFORE
UPDATE ON \"public\".\"bodyshops\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_bodyshops_updated_at\" ON \"public\".\"bodyshops\" \nIS
'trigger to set value of column \"updated_at\" to current timestamp on row update';\n"
type: run_sql
- args:
name: bodyshops
schema: public
type: add_existing_table_or_view

View File

@@ -1,11 +0,0 @@
- args:
sql: CREATE TABLE "public"."associations"("bodyshop" uuid NOT NULL, "user" uuid
NOT NULL, "active" boolean NOT NULL DEFAULT false, PRIMARY KEY ("bodyshop","user")
, FOREIGN KEY ("bodyshop") REFERENCES "public"."bodyshops"("id") ON UPDATE restrict
ON DELETE restrict, FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON
UPDATE restrict ON DELETE restrict);
type: run_sql
- args:
name: associations
schema: public
type: add_existing_table_or_view

View File

@@ -1,3 +0,0 @@
- args:
sql: DROP TABLE "public"."estimates"
type: run_sql

View File

@@ -1,20 +0,0 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"estimates\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
\"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
NOT NULL DEFAULT now(), \"est_number\" text NOT NULL, \"ro_number\" text NOT
NULL, \"shopid\" uuid NOT NULL, PRIMARY KEY (\"id\") , FOREIGN KEY (\"shopid\")
REFERENCES \"public\".\"bodyshops\"(\"id\") ON UPDATE restrict ON DELETE restrict);\nCREATE
OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_estimates_updated_at\"\nBEFORE
UPDATE ON \"public\".\"estimates\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_estimates_updated_at\" ON \"public\".\"estimates\" \nIS
'trigger to set value of column \"updated_at\" to current timestamp on row update';\n"
type: run_sql
- args:
name: estimates
schema: public
type: add_existing_table_or_view

View File

@@ -1,3 +0,0 @@
- args:
sql: DROP TABLE "public"."estimatelines"
type: run_sql

View File

@@ -1,20 +0,0 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"estimatelines\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
\"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
NOT NULL DEFAULT now(), \"estimate_id\" uuid NOT NULL, \"line_desc\" text NOT
NULL, PRIMARY KEY (\"id\") , FOREIGN KEY (\"estimate_id\") REFERENCES \"public\".\"estimates\"(\"id\")
ON UPDATE restrict ON DELETE restrict);\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_estimatelines_updated_at\"\nBEFORE
UPDATE ON \"public\".\"estimatelines\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_estimatelines_updated_at\" ON \"public\".\"estimatelines\"
\nIS 'trigger to set value of column \"updated_at\" to current timestamp on
row update';\n"
type: run_sql
- args:
name: estimatelines
schema: public
type: add_existing_table_or_view

View File

@@ -1,48 +0,0 @@
- args:
relationship: userByUser
table:
name: associations
schema: public
type: drop_relationship
- args:
relationship: bodyshopByBodyshop
table:
name: associations
schema: public
type: drop_relationship
- args:
relationship: associations
table:
name: bodyshops
schema: public
type: drop_relationship
- args:
relationship: estimates
table:
name: bodyshops
schema: public
type: drop_relationship
- args:
relationship: estimate
table:
name: estimatelines
schema: public
type: drop_relationship
- args:
relationship: bodyshop
table:
name: estimates
schema: public
type: drop_relationship
- args:
relationship: estimatelines
table:
name: estimates
schema: public
type: drop_relationship
- args:
relationship: associations
table:
name: users
schema: public
type: drop_relationship

View File

@@ -1,80 +0,0 @@
- args:
name: userByUser
table:
name: associations
schema: public
using:
foreign_key_constraint_on: user
type: create_object_relationship
- args:
name: bodyshopByBodyshop
table:
name: associations
schema: public
using:
foreign_key_constraint_on: bodyshop
type: create_object_relationship
- args:
name: associations
table:
name: bodyshops
schema: public
using:
foreign_key_constraint_on:
column: bodyshop
table:
name: associations
schema: public
type: create_array_relationship
- args:
name: estimates
table:
name: bodyshops
schema: public
using:
foreign_key_constraint_on:
column: shopid
table:
name: estimates
schema: public
type: create_array_relationship
- args:
name: estimate
table:
name: estimatelines
schema: public
using:
foreign_key_constraint_on: estimate_id
type: create_object_relationship
- args:
name: bodyshop
table:
name: estimates
schema: public
using:
foreign_key_constraint_on: shopid
type: create_object_relationship
- args:
name: estimatelines
table:
name: estimates
schema: public
using:
foreign_key_constraint_on:
column: estimate_id
table:
name: estimatelines
schema: public
type: create_array_relationship
- args:
name: associations
table:
name: users
schema: public
using:
foreign_key_constraint_on:
column: user
table:
name: associations
schema: public
type: create_array_relationship

View File

@@ -1,3 +0,0 @@
- args:
sql: ALTER TABLE "public"."users" DROP COLUMN "auth0id";
type: run_sql

View File

@@ -1,3 +0,0 @@
- args:
sql: ALTER TABLE "public"."users" ADD COLUMN "auth0id" text NULL;
type: run_sql

View File

@@ -1,6 +0,0 @@
- args:
sql: COMMENT ON COLUMN "public"."users"."auth0id" IS E'null'
type: run_sql
- args:
sql: alter table "public"."users" rename column "authid" to "auth0id";
type: run_sql

View File

@@ -1,6 +0,0 @@
- args:
sql: COMMENT ON COLUMN "public"."users"."auth0id" IS E''
type: run_sql
- args:
sql: alter table "public"."users" rename column "auth0id" to "authid";
type: run_sql

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_insert_permission

View File

@@ -1,23 +0,0 @@
- args:
permission:
allow_upsert: true
check:
authid:
_eq: X-Hasura-User-Id
columns:
- id
- username
- password
- created_at
- updated_at
- last_login
- authid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: users
schema: public
type: create_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_select_permission

View File

@@ -1,13 +0,0 @@
- args:
permission:
allow_aggregations: false
columns: []
filter:
authid:
_eq: X-Hasura-User-Id
limit: null
role: user
table:
name: users
schema: public
type: create_select_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_update_permission

View File

@@ -1,15 +0,0 @@
- args:
permission:
columns: []
filter:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: users
schema: public
type: create_update_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_delete_permission

View File

@@ -1,10 +0,0 @@
- args:
permission:
filter:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: users
schema: public
type: create_delete_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_insert_permission

View File

@@ -1,22 +0,0 @@
- args:
permission:
allow_upsert: true
check:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
columns:
- id
- shop_name
- created_at
- updated_at
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: bodyshops
schema: public
type: create_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_select_permission

View File

@@ -1,15 +0,0 @@
- args:
permission:
allow_aggregations: false
columns: []
filter:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
limit: null
role: user
table:
name: bodyshops
schema: public
type: create_select_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_update_permission

View File

@@ -1,17 +0,0 @@
- args:
permission:
columns: []
filter:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: bodyshops
schema: public
type: create_update_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_delete_permission

View File

@@ -1,12 +0,0 @@
- args:
permission:
filter:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: bodyshops
schema: public
type: create_delete_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_insert_permission

View File

@@ -1,20 +0,0 @@
- args:
permission:
allow_upsert: true
check:
userByUser:
authid:
_eq: X-Hasura-User-Id
columns:
- bodyshop
- user
- active
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_select_permission

View File

@@ -1,14 +0,0 @@
- args:
permission:
allow_aggregations: false
columns: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
limit: null
role: user
table:
name: associations
schema: public
type: create_select_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_update_permission

View File

@@ -1,16 +0,0 @@
- args:
permission:
columns: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_update_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_delete_permission

View File

@@ -1,11 +0,0 @@
- args:
permission:
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: associations
schema: public
type: create_delete_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: estimates
schema: public
type: drop_insert_permission

View File

@@ -1,25 +0,0 @@
- args:
permission:
allow_upsert: true
check:
bodyshop:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
columns:
- id
- created_at
- updated_at
- est_number
- ro_number
- shopid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: estimates
schema: public
type: create_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: estimates
schema: public
type: drop_select_permission

View File

@@ -1,22 +0,0 @@
- args:
permission:
allow_aggregations: false
columns:
- est_number
- ro_number
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
limit: null
role: user
table:
name: estimates
schema: public
type: create_select_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: estimates
schema: public
type: drop_update_permission

View File

@@ -1,24 +0,0 @@
- args:
permission:
columns:
- est_number
- ro_number
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: estimates
schema: public
type: create_update_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: estimates
schema: public
type: drop_delete_permission

View File

@@ -1,13 +0,0 @@
- args:
permission:
filter:
bodyshop:
associations:
userByUser:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: estimates
schema: public
type: create_delete_permission

View File

@@ -1,20 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns: []
computed_fields: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: associations
schema: public
type: create_select_permission

View File

@@ -1,23 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- bodyshop
- user
- active
computed_fields: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: associations
schema: public
type: create_select_permission

View File

@@ -1,22 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_update_permission
- args:
permission:
columns: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_update_permission

View File

@@ -1,25 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_update_permission
- args:
permission:
columns:
- active
- bodyshop
- user
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_update_permission

View File

@@ -1,22 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_update_permission
- args:
permission:
columns: []
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_update_permission

View File

@@ -1,25 +0,0 @@
- args:
role: user
table:
name: associations
schema: public
type: drop_update_permission
- args:
permission:
columns:
- active
- bodyshop
- user
filter:
userByUser:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: associations
schema: public
type: create_update_permission

View File

@@ -1,19 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns: []
computed_fields: []
filter:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: users
schema: public
type: create_select_permission

View File

@@ -1,26 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- id
- username
- password
- created_at
- updated_at
- last_login
- authid
computed_fields: []
filter:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: users
schema: public
type: create_select_permission

View File

@@ -1,21 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_update_permission
- args:
permission:
columns: []
filter:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: users
schema: public
type: create_update_permission

View File

@@ -1,28 +0,0 @@
- args:
role: user
table:
name: users
schema: public
type: drop_update_permission
- args:
permission:
columns:
- authid
- password
- username
- created_at
- last_login
- updated_at
- id
filter:
authid:
_eq: X-Hasura-User-Id
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: users
schema: public
type: create_update_permission

View File

@@ -1,6 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission

View File

@@ -1,14 +0,0 @@
- args:
permission:
allow_upsert: true
check: {}
columns: []
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,19 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission
- args:
permission:
check: {}
columns: []
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,21 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission
- args:
permission:
check: {}
columns:
- value
- key
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,19 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission
- args:
permission:
check: {}
columns: []
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,19 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission
- args:
permission:
check: {}
columns: []
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,13 +0,0 @@
- args:
permission:
check: {}
columns: []
localPresets:
- key: ""
value: ""
set: {}
role: anonymous
table:
name: masterdata
schema: public
type: create_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_insert_permission

View File

@@ -1,6 +0,0 @@
- args:
role: user
table:
name: masterdata
schema: public
type: drop_select_permission

View File

@@ -1,13 +0,0 @@
- args:
permission:
allow_aggregations: false
columns:
- value
- key
filter: {}
limit: null
role: user
table:
name: masterdata
schema: public
type: create_select_permission

View File

@@ -1,6 +0,0 @@
- args:
role: anonymous
table:
name: masterdata
schema: public
type: drop_select_permission

View File

@@ -1,13 +0,0 @@
- args:
permission:
allow_aggregations: false
columns:
- value
- key
filter: {}
limit: null
role: anonymous
table:
name: masterdata
schema: public
type: create_select_permission

View File

@@ -1,6 +1,6 @@
- args:
sql: CREATE TABLE "public"."masterdata"("key" text NOT NULL, "value" jsonb NOT
NULL, PRIMARY KEY ("key") , UNIQUE ("key"));
NULL, PRIMARY KEY ("key") );
type: run_sql
- args:
name: masterdata

View File

@@ -0,0 +1,15 @@
- args:
sql: "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\") );\nCREATE OR REPLACE
FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS TRIGGER
AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_users_updated_at\"\nBEFORE
UPDATE ON \"public\".\"users\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_users_updated_at\" ON \"public\".\"users\" \nIS 'trigger
to set value of column \"updated_at\" to current timestamp on row update';\n"
type: run_sql
- args:
name: users
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,11 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: CREATE TABLE "public"."bodyshops"("shopid" uuid NOT NULL DEFAULT gen_random_uuid(),
"name" text NOT NULL, PRIMARY KEY ("shopid") );
type: run_sql
- args:
name: bodyshops
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,11 @@
- args:
sql: CREATE TABLE "public"."associations"("shopid" uuid NOT NULL, "useremail"
text NOT NULL, "active" boolean NOT NULL DEFAULT false, PRIMARY KEY ("shopid","useremail")
, FOREIGN KEY ("shopid") REFERENCES "public"."bodyshops"("shopid") ON UPDATE
restrict ON DELETE restrict, FOREIGN KEY ("useremail") REFERENCES "public"."users"("email")
ON UPDATE restrict ON DELETE restrict);
type: run_sql
- args:
name: associations
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."jobs"
type: run_sql

View File

@@ -0,0 +1,13 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: CREATE TABLE "public"."jobs"("jobid" uuid NOT NULL DEFAULT gen_random_uuid(),
"ro_number" text NOT NULL, "est_number" text NOT NULL, "shopid" uuid NOT NULL,
PRIMARY KEY ("jobid") , FOREIGN KEY ("shopid") REFERENCES "public"."bodyshops"("shopid")
ON UPDATE restrict ON DELETE restrict);
type: run_sql
- args:
name: jobs
schema: public
type: add_existing_table_or_view