migrations icon indicating copy to clipboard operation
migrations copied to clipboard

Apply assets filter on sequences

Open ottaviano opened this issue 2 years ago • 2 comments

Q A
Type improvement
BC Break no
Fixed issues

Summary

Asset filter is used for tables and sequences on fromSchema, but only for tables on toSchema. It generates CREATE SEQUENCE migration query. This PR applies the filter for sequences on toSchema.

ottaviano avatar Feb 25 '23 13:02 ottaviano

Thank you for the PR, @ottaviano. Did you run into a specific problem that resulted into this change?

SenseException avatar Jun 25 '24 22:06 SenseException

@SenseException, I have a partitioned table project_result_item with 3 sub-tables: project_result_item_0, project_result_item_1, and project_result_item_2. When I run the doctrine:migration:diff command, it tries to drop the 3 sub-tables.

The "solution" I found is to completely ignore the project_result_item table with schema_filter, but Doctrine migration generates the sequence for the ignored table at every diff : CREATE SEQUENCE project_result_item_id_seq INCREMENT BY 1 MINVALUE 1 START 1

This happens because the filter does not apply to sequences during the toSchema phase.

ottaviano avatar Jun 26 '24 08:06 ottaviano