Questions tagged [django-south]

Tool to provide consistent, easy-to-use and database-agnostic database migrations for Django applications. Deprecated since Django 1.7.

South was a tool to provide consistent, easy-to-use and database-agnostic s for applications.

Since Django 1.7, the features previously provided by South are included directly in Django.

1022 questions
20
votes
3 answers

Migrating Django fixtures?

I have a Django application. I have .json fixture files containing test data, with unit tests that use the data to confirm the application is working properly. I also use South to migrate my database. After doing a few database migrations, my…
Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
19
votes
3 answers

Django - Change a ForeignKey relation to OneToOne

I am using South with my Django app. I have two models that I am changing from having a ForeignKey relation to having a OneToOneField relation. When I ran this migration on my dev database, it ran fine. When the migrations get ran as part of…
user35288
19
votes
6 answers

Do django db_index migrations run concurrently?

I'm looking to add a multi-column index to a postgres database. I have a non blocking SQL command to do this which looks like this: CREATE INDEX CONCURRENTLY shop_product_fields_index ON shop_product (id, ...); When I add db_index to my model and…
yekta
  • 3,363
  • 3
  • 35
  • 50
19
votes
1 answer

Why does Django South 1.0 use iteritems()?

I've just installed South 1.0 and when I was about to do my first migration I got this error message: ... /lib/python3.4/site-packages/south/migration/migrators.py", line 186, in _run_migration for name, db in…
JBC
  • 225
  • 1
  • 7
19
votes
2 answers

Django south: changing field type in data migration

I'm changing a field from CharField to IntegerField. The field name remains the same. The newly created field will be based off the old field. For example, if the old field was "L", it would have the number "1" instead. How can I accomplish this…
user2233706
  • 6,148
  • 5
  • 44
  • 86
19
votes
2 answers

Does changing a django models related_name attribute require a south migration?

I have a simple django model with a ForeignKey class FooModel(models.Model): foo = models.ForeignKey('Foo', related_name="foo_choices") bar = models.CharField(max_length=50) The related_name attribute exists already, but I'd like to change…
Toran Billups
  • 27,111
  • 40
  • 155
  • 268
19
votes
1 answer

Why does Django South require a default value when removing a field?

When I am removing a NOT NULL field using Django South, I get the following message: ? The field 'VisitOrder.end_date' does not have a default specified, yet is NOT NULL. ? Since you are removing this field, you MUST specify a default ? value to…
Ghopper21
  • 10,287
  • 10
  • 63
  • 92
18
votes
1 answer

What is the difference between south migrations and django migrations?

Can anyone please explain me the difference between south migrations and django migrations? What advantage/disadvantage one has over another?
Pransh Tiwari
  • 3,983
  • 1
  • 32
  • 43
18
votes
3 answers

No Such Column Error in Django App After South Migration

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…
Drew Cummins
  • 355
  • 2
  • 10
18
votes
1 answer

Django South Error: AttributeError: 'DateTimeField' object has no attribute 'model'`

So I'm trying to migrate a table by adding two columns to it. A startDate and an endDate. Using south for Django, this should be a simple migrate. I have loads of other tables with dateTimes in them as well, but for some reason I'm getting and issue…
jaredgilmore
  • 657
  • 8
  • 17
17
votes
1 answer

In a schemamigration, what should be the default value for a null=False field which I'm sure that won't have null values?

I want to add a ForeignKey field to my model. In order to achieve that, I did 3 steps: Added the ForeignKey field with null=True to my model, and then created a schemamigration. Created a datamigration in order to fill that foreign key with a…
Denilson Sá Maia
  • 47,466
  • 33
  • 109
  • 111
17
votes
1 answer

should south migration files be added to source control?

I'm wondering whats the "best" way to use South with multiple developers. Should the migration files be tracked? The problems rise when two developers create different changes to models.py from a same origin. If the migration files are tracked: It…
Iftah
  • 9,512
  • 2
  • 33
  • 45
17
votes
5 answers

Why use South during initial development?

I'm wondering about the advantages of using (django) South during heavy initial development of a project. At the early stages of development there's normally rapid model changing, frequent branching and merging (especially if you use a development…
adewinter
  • 193
  • 1
  • 8
17
votes
6 answers

django south fresh install --> error: unknown command 'schemamigration'

short story I run ./manage.py schemamigration junk_app --initial on a completely fresh django project right after freshly installing South ( http://south.aeracode.org/ ), and I get the following error: Unknown command: 'schemamigration' Type…
Alexander Bird
  • 38,679
  • 42
  • 124
  • 159
17
votes
4 answers

No fixture named 'X' found

I'm using Django 1.6 and I use South to handle migrations. In most of my application I used to have initial_data.json files. I converted them to be loaded with migrations rather than automatically by Django (as this is recommended in the…
Amir Rachum
  • 76,817
  • 74
  • 166
  • 248