cccs-web / core

CCCS' customized django web application
4 stars 11 forks source link

Migration problem with SubProject model #191

Closed pwhipp closed 9 years ago

pwhipp commented 9 years ago

If migrations are applied normally to staging (or were to be applied to production) they will fail because cvs/016 assumes the existence of a SubProject model.

The model does not exist. I believe you deleted it and edited the migration that added it here.

For the time being, I've commented out the column addition in the offending migration so that staging is up and running.

If the migration is no longer required you can delete it (and any corresponding model code), we always rebuild the staging database from production so we can use staging to eliminate issues like these without digging ourselves a hole that is hard to get out of. The last test of staging is always to run it on a live snapshot.

Editing the migration will not have removed the model from your local database which is why you may not have spotted the problem. It making lots of migrations it is a good idea to keep a copy of the live database handy as a dump to test them.

Pull down a copy of the live database and test it locally to reproduce the problem. Let me know if you need any help with this.

Always make changes locally, push them to the GitHub repository and deploy them from there to the server. Never commit anything into the working copies on the server - they cannot write back to the repository.

webstar0025 commented 9 years ago

Sorry Paul,

I didn't see this message. I think SubProject model is no longer required so the migration is not needed also.

I think the problem was occurred when I made migration. It seems to updated existing migration rather than making new migration.

Can we delete all migration files and make fresh migration from existing staging db?