django-south

Upgrading from Django 1.6 to 1.9: python manage.py migrate failure

牧云@^-^@ 提交于 2019-11-28 08:02:23
问题 I'm running Django 1.6.6 on production and have recently upgraded to 1.9.7 on staging (dev server). This update was performed on the server and I followed the steps outlined here Upgrading from South. I noticed that the structure of the migration files have changed, and they no longer include a create statement. This causes issues because if I pull this new code from my GitHub repo and run python manage.py makemigrations or python manage.py migrate , it says: django.db.utils.OperationalError:

No Such Column Error in Django App After South Migration

你离开我真会死。 提交于 2019-11-28 03:24:36
I've run into the same issue presented by the commenter here: Django South - table already exists There was no follow-up, so I thought I'd post a new question. I have a Django app whose migrations I manage with South. I added a field to my model then ran ./manage schemamigration my_app --auto which ran as expected. Running ./manage migrate my_app however, resulted in an error indicating that the table associated with the model I changed already exists. This led me to the above linked question, so running ./manage migrate my_app --fake resolved the table error, but now I'm getting a Django

Backwards migration with Django South

限于喜欢 提交于 2019-11-28 02:34:06
Ok, so this seems like a really silly thing to ask, and I'm sure I'm missing something somewhere. How do you perform a backwards migration using South on Django? So I've tweaked my models, created a migration with schemamigration , run the migration with migrate , and now I realise that's not quite what I wanted and I want it back the way before. Short of manually editing db tables and removing migration files, how should I go about rolling the migration back? I find references to backward migrations using South via Google, but have yet to find a solid code example for it. Can anyone help? You

Renaming an app with Django and South

你说的曾经没有我的故事 提交于 2019-11-27 20:04:59
问题 I am renaming an application to a more suitable name. In doing so, I want to ensure that South properly migrates the database (renames database tables and changes references in django_content_type or south_migrationhistory). I know how to migrate a model to a different app, but when I try rename the app itself, South does not recognize the migration history properly. Undesirable solution : In renaming old_app to new_app I could leave old_app/migrations intact and add new migrations to this

Using south to refactor a Django model with inheritance

我的梦境 提交于 2019-11-27 17:03:40
I was wondering if the following migration is possible with Django south and still retain data. Before: I currently have two apps, one called tv, one called movies, each with a VideoFile model (simplified here): tv/models.py: class VideoFile(models.Model): show = models.ForeignKey(Show, blank=True, null=True) name = models.CharField(max_length=1024, blank=True) size = models.IntegerField(blank=True, null=True) ctime = models.DateTimeField(blank=True, null=True) movies/models.py: class VideoFile(models.Model): movie = models.ForeignKey(Movie, blank=True, null=True) name = models.CharField(max

Why don't my south migrations work?

我的梦境 提交于 2019-11-27 16:34:44
First, I create my database. create database mydb; I add "south" to installed Apps. Then, I go to this tutorial: http://south.aeracode.org/docs/tutorial/part1.html The tutorial tells me to do this: $ py manage.py schemamigration wall --initial >>> Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate wall Great, now I migrate. $ py manage.py migrate wall But it gives me this error... django.db.utils.DatabaseError: (1146, "Table 'fable.south_migrationhistory' doesn't exist") So I use Google (which never works. hence my 870 questions asked on Stackoverflow), and I

Django South error with initial migration

半城伤御伤魂 提交于 2019-11-27 11:59:06
问题 I have a new Django 1.3 project and app that I've created. I added south to my settings.py and have not yet run syncdb . When I execute the following commands per the South tutorial and documentation, I received the error shown below. Any thoughts on what's causing the problem? Update: Not properly installing South (see answer). Is South 0.7.3 compatible with Django 1.3? Update: Yes. Commands Executed and South Error $ python ./manage.py schemamigration qexpenses --initial Creating migrations

How to reset migrations in Django 1.7

二次信任 提交于 2019-11-27 11:22:34
(I know there is a title the same as this, but the question is different). I have managed to get my development machine migrations and production migrations out of sync. I have a Django app which was using South. I had my own workflow that worked fine (it probably wasn't the correct way to do things, but I had no problems with it). Basically I have a script that copies the production database dump to my development machine. It also copied the migration files. That way the two were in synch, and I could run South commands as normal. Now I have upgraded to 1.7, and started using migrations. When

django 1.7 migrate gets error “table already exists”

微笑、不失礼 提交于 2019-11-27 10:55:20
I am trying to apply a migration but am getting the error: django.db.utils.OperationalError: (1050, "Table 'customers_customer' already exists") I get this by issuing the following command: python manage.py migrate My customer table already exists, so what do I do to let the migration know this, not error out, and run my modification to my model? I ran this on my local environment with local database with no problem. It is when I pointed my database to production and ran migrate above that I get this error. If you have the table created in the database, you can run python manage.py migrate -

Django South - table already exists

非 Y 不嫁゛ 提交于 2019-11-27 09:57:50
I am trying to get started with South. I had an existing database and I added South ( syncdb , schemamigration --initial ). Then, I updated models.py to add a field and ran ./manage.py schemamigration myapp --auto . It seemed to find the field and said I could apply this with ./manage.py migrate myapp . But, doing that gave the error: django.db.utils.DatabaseError: table "myapp_tablename" already exists tablename is the first table listed in models.py . I am running Django 1.2, South 0.7 Ashok since you already have the tables created in the database, you just need to run the initial migration