django south migrations sqlite to postgres on heroku -


i've been working stupidly without database migrations since django 1.2 , i've said enough enough, time times seeing 1.7 brings in db migrations. south new me, it's been rough ride trying things working straight, , right i'm pulling hair out trying working on heroku.

i think might have made things lot worse leaving late add south project. initial problems have been getting transition local heroku , being able migrate data. right i'm getting django.db.utils.programmingerror: column "campaign_id" of relation "beaconmanager_beacon" exists when trying run migrate on beaconmanager.

i guess need know right is:

  1. does south work different databases, have sqlite3 local development dev heroku server runs postgres?
  2. the error above, better delete migrations folders , attempt run convert_to_south on of apps?
  3. what correct way of using south on heroku – i've noticed migrations should made on local , pushed heroku, run schemamigration myapp --auto or migrate myapp.

sorry if sounds beginner stuff, have literally picked south.

working on heroku , south migrations have fallow steps.

1) generate schemamigrations files in develop environment. (/.manage.py schemamigration [app_name] --auto).

2) add these files git repository.

3) push git repository heroku.

4) apply migrations on heroku environment (heroku run /.manage.py migrate [app_name])

if want reset south migrations:

1) delete schemamigration files.

2) flush south migration_history table, if want delete 1 app in migration_history can use firfox addon sqllite manager delete app records in develop environment. (in production environment use database manager provider).

3) convert app south (./manage.py convert_to_south [app_name])

4) make model changes

5) create shemamigration files

6) migrate app


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -