Added find owner modal and basic searching logic.
This commit is contained in:
1
hasura/migrations/1580321100336_owner_gin_idx/down.yaml
Normal file
1
hasura/migrations/1580321100336_owner_gin_idx/down.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
6
hasura/migrations/1580321100336_owner_gin_idx/up.yaml
Normal file
6
hasura/migrations/1580321100336_owner_gin_idx/up.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "\r\nCREATE INDEX owner_gin_idx ON owners\r\nUSING GIN ((ownr_fn || ' '
|
||||
|| ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip ||
|
||||
' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2 ) gin_trgm_ops);\r\n"
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,14 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "CREATE FUNCTION search_owners(search text)\r\nRETURNS SETOF owners AS $$\r\n
|
||||
\ SELECT *\r\n FROM owners\r\n WHERE\r\n search <% (ownr_fn ||
|
||||
' ' || ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip
|
||||
\ || ' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2)\r\n ORDER BY\r\n
|
||||
\ similarity(search, (ownr_fn || ' ' || ownr_ln || ' ' || ownr_addr1 ||
|
||||
' ' || ownr_city || ' ' || ownr_zip || ' ' || ownr_ea || ' ' || ownr_ph1 ||
|
||||
' ' || ownr_ph2)) DESC\r\n LIMIT 20;\r\n$$ LANGUAGE sql STABLE;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_owners
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_co_nm";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,3 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_co_nm" text NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_insert_permission
|
||||
- args:
|
||||
permission:
|
||||
check:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_ph1
|
||||
- preferred_contact
|
||||
- allow_text_message
|
||||
- shopid
|
||||
- ownr_ph2
|
||||
- ownr_co_nm
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_insert_permission
|
||||
@@ -0,0 +1,42 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,43 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
computed_fields: []
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,44 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,45 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- allow_text_message
|
||||
- ownr_addr1
|
||||
- ownr_addr2
|
||||
- ownr_city
|
||||
- ownr_co_nm
|
||||
- ownr_ctry
|
||||
- ownr_ea
|
||||
- ownr_fn
|
||||
- ownr_ln
|
||||
- ownr_ph1
|
||||
- ownr_ph2
|
||||
- ownr_st
|
||||
- ownr_zip
|
||||
- preferred_contact
|
||||
- created_at
|
||||
- updated_at
|
||||
- id
|
||||
- shopid
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
_and:
|
||||
- user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
- active:
|
||||
_eq: true
|
||||
localPresets:
|
||||
- key: ""
|
||||
value: ""
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: owners
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
Reference in New Issue
Block a user