Merge lp://staging/~elachuni/rnr-server/null-reviewmoderationflag-user into lp://staging/rnr-server

Proposed by Anthony Lenton
Status: Merged
Approved by: Michael Nelson
Approved revision: 167
Merged at revision: 167
Proposed branch: lp://staging/~elachuni/rnr-server/null-reviewmoderationflag-user
Merge into: lp://staging/rnr-server
Diff against target: 162 lines (+158/-0)
1 file modified
src/reviewsapp/migrations/0009_null_reviewmoderationflag_user.py (+158/-0)
To merge this branch: bzr merge lp://staging/~elachuni/rnr-server/null-reviewmoderationflag-user
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+54535@code.staging.launchpad.net

Commit message

Add a migration to bring our migrated DB in sync with our models.

Description of the change

Overview
========
A branch with a single migration to bring our migrated DB in sync with our models. It seems in migration 0003 ReviewModerationFlag.user was allowed to be null, but the migration didn't change that field in the DB.

Details
=======
The change should be idempotent when applying forward, so there should be no problem applying the change at this point. Migrating backwards will not work once we have rows with null users.

As for testing, as all migrations this will need to be tested manually on the daily box until we've got automatic migration test infrastructure in place. I've inspected the resulting schema locally and it looks right.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Looks good (I wasn't familiar with the to: syntax). I'll trust that you've checked the resulting schema.

15:50 < noodles> achuni: won't the backwards migration work just fine (as it'll update 'back' to null=True?)
15:51 < achuni> noodles: ah hm
15:51 < achuni> hmmm
15:51 < noodles> (I assume south is just using the orm spec from the previous migration right?)
15:52 < achuni> noodles: you're right, the signature in the backwards method is just a guessed comment, it'll migrate "back" to the frozen state from the previous migration
15:52 < achuni> noodles: so actually the migration that will break when migrating backwards is 0003, if we have null users in reviewmoderationflag objects
15:53 < noodles> Yep.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches