Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#25896 closed Bug (fixed)

SeparateDatabaseAndState.database_backwards() applies state incorrectly

Reported by: Amos Onn Owned by: Amos Onn
Component: Migrations Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

When there are various database ops in SeparateDatabaseAndState, and they depend on each other, database_backwards is broken because it applies states incorrectly.
The code exists unchanged in 1.9 and master.
Test coverage for SeparateDatabaseAndState was incomplete anyway, added a more thorough test which breaks, and the bug fix.

Change History (8)

comment:1 Changed 3 years ago by Amos Onn

Status: newassigned

comment:2 Changed 3 years ago by Tim Graham

Patch needs improvement: set
Summary: SeparateDatabaseAndState database_backwards is broken.SeparateDatabaseAndState.database_backwards() applies state incorrectly
Triage Stage: UnreviewedAccepted

comment:3 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 542b7f6c:

Fixed #25896 -- Fixed state bug in SeparateDatabaseAndState.database_backwards().

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

In 0772bffd:

[1.8.x] Fixed #25896 -- Fixed state bug in SeparateDatabaseAndState.database_backwards().

Backport of 542b7f6c50df18f2aa201cf1de81577c1bee643c from master

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

In f076cf07:

[1.9.x] Fixed #25896 -- Fixed state bug in SeparateDatabaseAndState.database_backwards().

Backport of 542b7f6c50df18f2aa201cf1de81577c1bee643c from master

comment:6 Changed 3 years ago by Shai Berger <shai@…>

In c8b3fbe2:

Refs #25896 -- Fixed migration test failure on Oracle

The test creates and deletes a model in the same migration, and the model
had an AutoField. On Oracle, AutoField's are set up using deferred SQL, which
in this case was trying to modify a table after it had dbeen removed.

comment:7 Changed 3 years ago by Shai Berger <shai@…>

In f1964bc:

[1.9.x] Refs #25896 -- Fixed migration test failure on Oracle

The test creates and deletes a model in the same migration, and the model
had an AutoField. On Oracle, AutoField's are set up using deferred SQL, which
in this case was trying to modify a table after it had dbeen removed.

Backport of c8b3fbe from master

comment:8 Changed 3 years ago by Shai Berger <shai@…>

In 02c049ab:

[1.8.x] Refs #25896 -- Fixed migration test failure on Oracle

The test creates and deletes a model in the same migration, and the model
had an AutoField. On Oracle, AutoField's are set up using deferred SQL, which
in this case was trying to modify a table after it had dbeen removed.

Backport of c8b3fbe from master

Note: See TracTickets for help on using tickets.
Back to Top