IO-710 Export Log page & insert actions on export
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."exportlog" ALTER COLUMN "message" SET NOT NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."exportlog" ALTER COLUMN "message" DROP NOT NULL;
|
||||
type: run_sql
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
17
hasura/migrations/1619039107283_run_sql_migration/up.yaml
Normal file
17
hasura/migrations/1619039107283_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "CREATE\r\nOR REPLACE FUNCTION public.search_exportlog(search text) RETURNS
|
||||
SETOF exportlog LANGUAGE plpgsql STABLE AS $function$ BEGIN IF search = '' THEN
|
||||
RETURN query\r\nSELECT\r\n *\r\nFROM\r\n exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n
|
||||
\ exportlog.*\r\nFROM\r\n exportlog e,\r\n jobs j,\r\n payments p,\r\n bills
|
||||
b,\r\n users u\r\nWHERE\r\n (\r\n j.ro_number ILIKE '%' || search || '%'\r\n
|
||||
\ OR b.invoice_number ILIKE '%' || search || '%'\r\n OR p.paymentnum ILIKE
|
||||
'%' || search || '%'\r\n OR u.email ILIKE '%' || search || '%'\r\n\r\n )\r\n
|
||||
\ AND (e.jobid = j.id\r\n or e.paymentid = p.id\r\n or e.billid = b.id\r\nor
|
||||
e.useremail = u.email)\r\n;\r\nEND IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
18
hasura/migrations/1619039299307_run_sql_migration/up.yaml
Normal file
18
hasura/migrations/1619039299307_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n exportlog.*\r\nFROM\r\n
|
||||
\ exportlog e,\r\n jobs j,\r\n payments p,\r\n bills b,\r\n users u\r\nWHERE\r\n
|
||||
\ (\r\n j.ro_number ILIKE '%' || search || '%'\r\n OR b.invoice_number
|
||||
ILIKE '%' || search || '%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n
|
||||
\ OR u.email ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid = j.id\r\n
|
||||
\ or e.paymentid = p.id\r\n or e.billid = b.id\r\nor u.useremail = u.email)\r\n;\r\nEND
|
||||
IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
18
hasura/migrations/1619039339617_run_sql_migration/up.yaml
Normal file
18
hasura/migrations/1619039339617_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e,\r\n jobs j,\r\n payments p,\r\n bills b,\r\n users u\r\nWHERE\r\n (\r\n
|
||||
\ j.ro_number ILIKE '%' || search || '%'\r\n OR b.invoice_number ILIKE
|
||||
'%' || search || '%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n OR
|
||||
u.email ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid = j.id\r\n or
|
||||
e.paymentid = p.id\r\n or e.billid = b.id\r\nor u.useremail = u.email)\r\n;\r\nEND
|
||||
IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
17
hasura/migrations/1619039390662_run_sql_migration/up.yaml
Normal file
17
hasura/migrations/1619039390662_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e,\r\n jobs j,\r\n payments p,\r\n bills b\r\nWHERE\r\n (\r\n j.ro_number
|
||||
ILIKE '%' || search || '%'\r\n OR b.invoice_number ILIKE '%' || search ||
|
||||
'%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n OR e.useremail
|
||||
ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid = j.id\r\n or e.paymentid
|
||||
= p.id\r\n or e.billid = b.id)\r\n;\r\nEND IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
17
hasura/migrations/1619039746435_run_sql_migration/up.yaml
Normal file
17
hasura/migrations/1619039746435_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e,\r\n jobs j,\r\n payments p,\r\n bills b\r\nWHERE\r\n(e.jobid = j.id and
|
||||
\ j.ro_number ILIKE '%' || search || '%') OR\r\n(e.paymentid = p.id and p.paymentnum
|
||||
ILIKE '%' || search || '%') OR\r\n(e.billid = b.id and b.invoice_number ILIKE
|
||||
'%' || search || '%') OR\r\n e.useremail ILIKE '%' || search || '%'\r\n\r\n
|
||||
\r\n \r\n;\r\nEND IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
18
hasura/migrations/1619039995255_run_sql_migration/up.yaml
Normal file
18
hasura/migrations/1619039995255_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e\r\nINNER JOIN payments p \r\n ON p.id = e.paymentid\r\nINNER JOIN bills
|
||||
b\r\n ON e.billid = b.id\r\n \r\nWHERE\r\n\r\n\r\n\r\n (\r\n j.ro_number
|
||||
ILIKE '%' || search || '%'\r\n OR b.invoice_number ILIKE '%' || search ||
|
||||
'%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n OR e.useremail
|
||||
ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid = j.id\r\n or e.paymentid
|
||||
= p.id\r\n \r\n or e.billid = b.id)\r\n \r\n \r\n;\r\nEND IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
19
hasura/migrations/1619040031634_run_sql_migration/up.yaml
Normal file
19
hasura/migrations/1619040031634_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e\r\n INNER JOIN jobs j on j.id = e.jobid\r\nINNER JOIN payments p \r\n ON
|
||||
p.id = e.paymentid\r\nINNER JOIN bills b\r\n ON e.billid = b.id\r\n \r\nWHERE\r\n\r\n\r\n\r\n
|
||||
\ (\r\n j.ro_number ILIKE '%' || search || '%'\r\n OR b.invoice_number
|
||||
ILIKE '%' || search || '%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n
|
||||
\ OR e.useremail ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid =
|
||||
j.id\r\n or e.paymentid = p.id\r\n \r\n or e.billid = b.id)\r\n \r\n \r\n;\r\nEND
|
||||
IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
19
hasura/migrations/1619040190377_run_sql_migration/up.yaml
Normal file
19
hasura/migrations/1619040190377_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: "drop function public.search_exportlog;\r\n\r\nCREATE\r\nOR REPLACE FUNCTION
|
||||
public.search_exportlog(search text) RETURNS SETOF exportlog LANGUAGE plpgsql
|
||||
STABLE AS $function$ BEGIN IF search = '' THEN RETURN query\r\nSELECT\r\n *\r\nFROM\r\n
|
||||
\ exportlog e;\r\n ELSE RETURN query\r\nSELECT\r\n e.*\r\nFROM\r\n exportlog
|
||||
e\r\n LEFT JOIN jobs j on j.id = e.jobid\r\nLEFT JOIN payments p \r\n ON
|
||||
p.id = e.paymentid\r\nLEFT JOIN bills b\r\n ON e.billid = b.id\r\n \r\nWHERE\r\n\r\n\r\n\r\n
|
||||
\ (\r\n j.ro_number ILIKE '%' || search || '%'\r\n OR b.invoice_number
|
||||
ILIKE '%' || search || '%'\r\n OR p.paymentnum ILIKE '%' || search || '%'\r\n
|
||||
\ OR e.useremail ILIKE '%' || search || '%'\r\n\r\n )\r\n AND (e.jobid =
|
||||
j.id\r\n or e.paymentid = p.id\r\n \r\n or e.billid = b.id)\r\n \r\n \r\n;\r\nEND
|
||||
IF;\r\nEND $function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_exportlog
|
||||
schema: public
|
||||
type: track_function
|
||||
@@ -4334,6 +4334,9 @@ functions:
|
||||
- function:
|
||||
schema: public
|
||||
name: search_cccontracts
|
||||
- function:
|
||||
schema: public
|
||||
name: search_exportlog
|
||||
- function:
|
||||
schema: public
|
||||
name: search_jobs
|
||||
|
||||
Reference in New Issue
Block a user