fix: fn_vehicle_trips takes bigint (domain.vehicles.vehicle_id is bigserial)
PG function overloading is type-strict: integer→bigint isn't implicit. The prior signature (integer, date) didn't match callers passing vehicle_id directly. Also prepends a DROP for the integer-signature in case the previous migration ran and left a now-orphan function around.
This commit is contained in:
parent
9393491869
commit
0265477f46
1 changed files with 7 additions and 1 deletions
|
|
@ -33,8 +33,13 @@
|
|||
-- Falls back to movement-only segmentation (has_acc_data=false in the
|
||||
-- response) when every position for the day has acc_state IS NULL.
|
||||
|
||||
-- Drop any prior signature; the function identity is (name + arg types),
|
||||
-- so a CREATE OR REPLACE with a different arg type would create a sibling.
|
||||
DROP FUNCTION IF EXISTS serve.fn_vehicle_trips(integer, date);
|
||||
DROP FUNCTION IF EXISTS serve.fn_vehicle_trips(bigint, date);
|
||||
|
||||
CREATE OR REPLACE FUNCTION serve.fn_vehicle_trips(
|
||||
p_vehicle_id integer,
|
||||
p_vehicle_id bigint,
|
||||
p_date_eat date
|
||||
) RETURNS jsonb
|
||||
LANGUAGE plpgsql STABLE
|
||||
|
|
@ -385,4 +390,5 @@ $fn$;
|
|||
|
||||
-- migrate:down
|
||||
|
||||
DROP FUNCTION IF EXISTS serve.fn_vehicle_trips(bigint, date);
|
||||
DROP FUNCTION IF EXISTS serve.fn_vehicle_trips(integer, date);
|
||||
|
|
|
|||
Loading…
Reference in a new issue