Merge branch 'feature/cdk-cert' into feature/qbo

This commit is contained in:
Patrick Fic
2021-08-25 12:08:06 -07:00
35 changed files with 2402 additions and 1443 deletions

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: DROP TABLE "public"."dms_vehicles";
type: run_sql

View File

@@ -0,0 +1,18 @@
- args:
cascade: false
read_only: false
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
cascade: false
read_only: false
sql: CREATE TABLE "public"."dms_vehicles"("id" uuid NOT NULL DEFAULT gen_random_uuid(),
"created_at" timestamptz NOT NULL DEFAULT now(), "makecode" text NOT NULL, "modelcode"
text NOT NULL, "make" text NOT NULL, "model" text NOT NULL, "bodyshopid" uuid
NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id")
ON UPDATE cascade ON DELETE cascade);
type: run_sql
- args:
name: dms_vehicles
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,12 @@
- args:
relationship: dms_vehicles
table:
name: bodyshops
schema: public
type: drop_relationship
- args:
relationship: bodyshop
table:
name: dms_vehicles
schema: public
type: drop_relationship

View File

@@ -0,0 +1,20 @@
- args:
name: dms_vehicles
table:
name: bodyshops
schema: public
using:
foreign_key_constraint_on:
column: bodyshopid
table:
name: dms_vehicles
schema: public
type: create_array_relationship
- args:
name: bodyshop
table:
name: dms_vehicles
schema: public
using:
foreign_key_constraint_on: bodyshopid
type: create_object_relationship

View File

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

View File

@@ -0,0 +1,28 @@
- args:
permission:
allow_aggregations: false
backend_only: false
columns:
- id
- created_at
- makecode
- modelcode
- make
- model
- bodyshopid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
limit: null
role: user
table:
name: dms_vehicles
schema: public
type: create_select_permission

View File

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

View File

@@ -0,0 +1,27 @@
- args:
permission:
allow_upsert: true
backend_only: false
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- makecode
- modelcode
- make
- model
- bodyshopid
set: {}
role: user
table:
name: dms_vehicles
schema: public
type: create_insert_permission

View File

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

View File

@@ -0,0 +1,26 @@
- args:
permission:
backend_only: false
columns:
- make
- makecode
- model
- modelcode
- created_at
- bodyshopid
- id
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: dms_vehicles
schema: public
type: create_update_permission

View File

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

View File

@@ -0,0 +1,17 @@
- args:
permission:
backend_only: false
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: dms_vehicles
schema: public
type: create_delete_permission

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,13 @@
- args:
cascade: true
read_only: false
sql: CREATE OR REPLACE FUNCTION public.search_dms_vehicles(search text)RETURNS
SETOF dms_vehicles LANGUAGE plpgsql STABLE AS $FUNCTION$ BEGIN IF search=''
THEN RETURN query SELECT*FROM dms_vehicles;ELSE RETURN query SELECT*FROM dms_vehicles
WHERE make ILIKE'%'||search||'%' OR model ILIKE'%'||search||'%' ORDER BY make
ILIKE'%'||search||'%' OR NULL,model ILIKE'%'||search||'%' OR NULL;END IF;END$FUNCTION$;
type: run_sql
- args:
name: search_dms_vehicles
schema: public
type: track_function

View File

@@ -721,6 +721,13 @@ tables:
table:
schema: public
name: csiquestions
- name: dms_vehicles
using:
foreign_key_constraint_on:
column: bodyshopid
table:
schema: public
name: dms_vehicles
- name: documents
using:
foreign_key_constraint_on:
@@ -1527,6 +1534,87 @@ tables:
- active:
_eq: true
check: null
- table:
schema: public
name: dms_vehicles
object_relationships:
- name: bodyshop
using:
foreign_key_constraint_on: bodyshopid
insert_permissions:
- role: user
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- makecode
- modelcode
- make
- model
- bodyshopid
backend_only: false
select_permissions:
- role: user
permission:
columns:
- id
- created_at
- makecode
- modelcode
- make
- model
- bodyshopid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
update_permissions:
- role: user
permission:
columns:
- make
- makecode
- model
- modelcode
- created_at
- bodyshopid
- id
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
delete_permissions:
- role: user
permission:
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
schema: public
name: documents
@@ -4554,6 +4642,9 @@ functions:
- function:
schema: public
name: search_cccontracts
- function:
schema: public
name: search_dms_vehicles
- function:
schema: public
name: search_exportlog