Describe the bug
Using COMMIT; BEGIN; within a migration file (eg. to separate enum updates so they can be used in the same file with UPDATE / INSERT) shows a warning and appears to be successful, but does not apply anything below BEGIN; or any subsequent migration files. Running supabase db push again will show the same migration files waiting to be pushed.
ALTER TYPE tech_tree_vehicle_filter ADD VALUE IF NOT EXISTS 'cruise';
COMMIT;
BEGIN;
UPDATE tech_tree_nodes
SET vehicle_filter = 'courier'
WHERE key IN (
'courier_route_optimiser',
'courier_max_stops_10',
'courier_electric_subsidy',
'courier_locker_network',
'courier_b2b_accounts',
'courier_returns_specialist'
);
Note: I'm aware that transactions need to be wrapped properly, but because this didn't error, I didn't catch the issue and wondered why many of my subsequent migrations weren't actually applied.
To Reproduce
Steps to reproduce the behavior:
- Add
COMMIT; BEGIN; to xxx_01.sql eg. to separate enums to use the value later in the file (INSERT / UPDATE)
- Create another migration file without
- Get the following:
WARNING (25P01): there is no transaction in progress
Applying migration xxx_02.sql...
Finished supabase db push.
Expected behavior
THE CLI should bail with an error, not a warning.
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID: N/A
- Version of OS: Ubuntu 24.04
- Version of CLI: 2.84.7
- Version of Docker: Docker version 29.3.1, build c2be9cc
- Versions of services: N/A
Describe the bug
Using
COMMIT; BEGIN;within a migration file (eg. to separate enum updates so they can be used in the same file with UPDATE / INSERT) shows a warning and appears to be successful, but does not apply anything belowBEGIN;or any subsequent migration files. Runningsupabase db pushagain will show the same migration files waiting to be pushed.Note: I'm aware that transactions need to be wrapped properly, but because this didn't error, I didn't catch the issue and wondered why many of my subsequent migrations weren't actually applied.
To Reproduce
Steps to reproduce the behavior:
COMMIT; BEGIN;toxxx_01.sqleg. to separate enums to use the value later in the file (INSERT / UPDATE)Expected behavior
THE CLI should bail with an error, not a warning.
System information
Rerun the failing command with
--create-ticketflag.