Added vehicle search function + paginated vehicles page BOD-116
This commit is contained in:
@@ -0,0 +1 @@
|
||||
[]
|
||||
13
hasura/migrations/1594680221027_run_sql_migration/up.yaml
Normal file
13
hasura/migrations/1594680221027_run_sql_migration/up.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
- args:
|
||||
cascade: true
|
||||
read_only: false
|
||||
sql: "CREATE OR REPLACE FUNCTION public.search_vehicles(search text)\n RETURNS
|
||||
SETOF vehicles\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search
|
||||
= '' then\n return query select * from vehicles ;\n else \n return query
|
||||
SELECT\n *\nFROM\n vehicles\nWHERE\n search <% (v_vin) OR\n search <% (plate_no);\n
|
||||
\ end if;\n\n\tEND\n$function$;"
|
||||
type: run_sql
|
||||
- args:
|
||||
name: search_vehicles
|
||||
schema: public
|
||||
type: track_function
|
||||
Reference in New Issue
Block a user