-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Labels
rails 7.1issue introduced in rails 7.1issue introduced in rails 7.1
Description
All of these tests are failing:
- test_dump_foreign_key_targeting_different_schema
- test_schema_dumping
- test_schema_dumping_on_delete_and_on_update_options
- test_schema_dumping_with_validate_false
- test_schema_dumping_with_validate_true
- test_schema_dumping_with_custom_fk_ignore_pattern
I haven't verified for all of them, but for most the bug is actually that the fk is not validated. This likely comes from :
We can't support adding a validated foreign key constraint in the same
transaction as the CREATE TABLE statement. This would require adding
the backreference to the other table and then validating the constraint
for whatever rows were inserted into the referencing table in this
transaction, which requires multiple schema changer states across
multiple transactions.We could partially fix this by queuing a validation job to run post-
transaction. Better yet would be to absorb this into the transactional
schema change framework eventually.For now, just always add the FK as unvalidated.
fk.ForeignKeyDesc().Validity = descpb.ConstraintValidity_Unvalidated
Metadata
Metadata
Assignees
Labels
rails 7.1issue introduced in rails 7.1issue introduced in rails 7.1