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
12
votes
1 answer

Adding Autoincrement field to existing model with Django South?

I have a Django project that started as an import of a legacy database. Because of this, there is a model with a composite primary key. This worked as long as I used only the legacy data, but now I want to add new data and the form I created is…
murgatroid99
  • 19,007
  • 10
  • 60
  • 95
12
votes
3 answers

django loading data from fixture after backward migration / loaddata is using model schema not database schema

I have recenty came across a problem while importing older data than my current model schema. Flow which I use and lead to error: dumpdata with python manage.py dumpdata -> 0002 make some modifications to model generate migration with python…
lechup
  • 3,031
  • 27
  • 26
12
votes
1 answer

South with django 1.7

I'm using django 1.7 for my application. I came across several problems with migrate. Everytime I try to change a field name in models which is a foreign key, it breaks. The only fix would be to go to database and fix it, and they run migrate…
theblackpearl
  • 1,164
  • 3
  • 15
  • 34
12
votes
3 answers

South migrate error - relation already exists

Background: After adding djangoratings to my project, I tried running django-admin.py schemamigration djangoratings --initial --settings=myapp.settings.local which resulted in an unknown command error for schemamigration. I tried to resolve this…
Derek
  • 520
  • 1
  • 5
  • 19
12
votes
1 answer

Django South migration conflict while working in a team

I have a short question about how to use Django-South while working in a team. What happens if two people simultaneously create migration file on changes to the same file? For example, A and B are working on same Django app. They are working in…
JunYoung Gwak
  • 2,967
  • 3
  • 21
  • 35
12
votes
1 answer

What is the correct way to deal with DB migration while using South, Django and Git?

Background :- I am using Django 1.3. We are using South as the module for DB migration and Git SCM. Problem:- What is the correct way to deal with the migrations Folder that is formed? The main problem is I make changes in the DB schema in the…
Akamad007
  • 1,551
  • 3
  • 22
  • 38
11
votes
1 answer

Django South migration not working with null = True and blank = True

I am using South with Django for database migrations. In my models.py I changed one of the fields from class User(models.Model): group = models.ForeignKey(Group) to class User(models.Model): group = models.ForeignKey(Group, null = True,…
hobbes3
  • 28,078
  • 24
  • 87
  • 116
11
votes
2 answers

What does a South datamigration do compared to a schemamigration?

I recently began digging into the South documentation and discovered that it had two distinct types of migrations: schemamigration datamigration As a result of my ignorance, I've always used schemamigrations for everything. In other words, even if…
Huuuze
  • 15,528
  • 25
  • 72
  • 91
11
votes
2 answers

How do I change the choices in a Django model?

I have a Django model that uses the choices attribute. COLOR_CHOICES = ( ('R', 'Red'), ('B', 'Blue'), ) class Toy(models.Model): color = models.CharField(max_length=1, choices=COLOR_CHOICES) My code is in production and now I'd like to…
Adam
  • 43,763
  • 16
  • 104
  • 144
11
votes
3 answers

accessing model manager methods in datamigration

I am trying to formulate a datamigration for one of my apps. I am using the reputation system mentioned here - django-reputation in my forward method, I have the following code - orm['reputation.reputation'].objects.log_reputation_action(user =…
Keval Doshi
  • 738
  • 6
  • 25
11
votes
4 answers

Deploying a (single node) Django Web application with virtually zero downtime on EC2

Question: What are good strategies for achieving 0 (or as close as possible to 0) downtime when using Django? Most of the answer I read say "use south" or "use fabric", but those are very vague answer IMHO. I actually use both, and am still…
rburhum
  • 1,611
  • 2
  • 17
  • 33
10
votes
3 answers

django south migration, doesnt set default

I use south to migrate my django models. There is however a nasty bug in south. It doesn't set default values in Postgres Databases. Example: created_at = models.DateTimeField(default = datetime.now) tag_id = models.PositiveIntegerField(default =…
jerrymouse
  • 16,964
  • 16
  • 76
  • 97
10
votes
1 answer

Django south - how to abandon a mistaken (and broken) migration

"South" is the tool that automates database migrations for Django. How can I "abandon" or "delete" a pending django south migration? I made a mistake and briefly asked django to make an impossible constraint. I thus can't get past step 09 to get…
Bryce
  • 8,313
  • 6
  • 55
  • 73
10
votes
2 answers

Using Django South to move from concrete inheritance to abstract inheritance

I have an existing Django project that has several models using concrete inheritance of a base class. After closer consideration, and after reading about what people like Jacob Kaplan-Moss have to say about it, using this concrete inheritance is…
Spike
  • 5,040
  • 5
  • 32
  • 47
10
votes
2 answers

Do I need to call syncdb before or after South migrate

I'm new to South so I am wondering if I ever need to call ./manage.py syncdb or doing ./manage.py schemamigration appname --auto ./manage.py migrate appname is sufficient in all cases South can handle on its own.
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511