Skip to content

Use COPY to populate schema_migrations table

Andreas Brandl requested to merge ab/structure-conflicts into master

What does this MR do?

This is intended to reduce the conflict potential in db/structure.sql. At the end of the file, we populate schema_migrations with a INSERT statement which contains one schema version per line. The INSERT structure with , delimiters and ; at the end has potential to cause conflicts when adding migrations in different branches.

Here, we turn this into a COPY to remove the clutter and only have one version per line - without any delimiters except new lines. This reduces the conflict potential a little and perhaps makes it a little easier to deal with conflicts. Note there are conflict types left that would still happen: If two branches append a single version to the end of the list, this is not conflict-free with the default merge strategy.

Closes #212051 (closed).

Edited by 🤖 GitLab Bot 🤖

Merge request reports