boundary icon indicating copy to clipboard operation
boundary copied to clipboard

fix(db): Remove begin when assembling migrations

Open tmessi opened this issue 1 year ago • 0 comments

When building the set of migrations to run as part of executing the database migrate or database init, the migrations are collected and combined to run within a database transaction. As such the begin and commit statements in the migration files should get removed from the final set of statements that get executed. However, when the migrations files were updated to include copyright and license headers, this broke the logic that would strip out the begin statement.

While this does not cause any issue with executing the statements in a single transaction, it does result in noise in the database server's logs, with log messages like:

BEGIN WARNING:  25001: there is already a transaction in progress
BEGIN LOCATION:  BeginTransactionBlock, xact.c:3778

This commit fixes the logic to correctly strip the begin for files that have the header lines.

tmessi avatar Oct 03 '24 13:10 tmessi