Open gbp opened 5 years ago
Looks like there are two cases:
PublicBody#api_key
Should have been set by https://github.com/mysociety/alaveteli/blob/develop/db/migrate/112_add_api_key_to_public_bodies.rb#L54
In this case it looks like the migration may have been incorrectly added initially (4dec55f3f3672e806b24aef99f6211034c49e9d6), run, and then correctly applied to the same migration in 1d2ceb988b910acdcd60910398ccd05de1688334. This probably wasn't manually fixed on the prod database.
RequestClassification
timestampsShould have been set by https://github.com/mysociety/alaveteli/blob/develop/db/migrate/20120910153022_create_request_classifications.rb#L7.
Similarly, 9478c601a5557902f605dc2fa559e7045cbd94e4 was added after the migration had been initially run, so it wouldn't have "fixed" existing databases.
9478c601a5557902f605dc2fa559e7045cbd94e4 got added in https://github.com/mysociety/alaveteli/pull/3768, which was prep for https://github.com/mysociety/alaveteli/issues/2968. Annoyingly I can't find much information about it, and my poor commit message doesn't shed any light on the situation.
Just linking this against https://github.com/mysociety/alaveteli/issues/4614, as they're similar issues that might want to get fixed at the same time.
This came up when annotating models.
One issue is the ordering which could be fixed by using the
--sort
or--classified-sort
when runningannotate
. For now we can easily ignore these and not stage them.The other appears we're missing NOT NULL on production DB columns. We should consider adding a new migration for these.
Remove: db:migrate, Added: production