mysociety/sayit — pull request #36 by osfameron (2013-05-21 09:23:15+00:00)
Title: migration for recordingtimestamp for #31

This is the first step, sanitizing the relationship to

Many recordingtimestamps -> One recording. (previously m2m)

NOTE: I've hard-coded some assertions about the existing m2m relationship being effectively 1-to-many. This could cause migration to fail, but I wanted to have a hard error while developing, rather than make a lossy migration.

Should I get a copy of any production DB to test with?
Or are we happy to allow a lossy migration given SayIt is at an early stage for now?

Relevant file is speeches/migrations/0033_convert_timestamps_to_fk.py

``` 12 if recording_set.count() == 0:
13 raise Exception("No recording!")
14 if recording_set.count() > 1:
15 raise Exception("Actual M2M data, eeeek!")```