south

How do I migrate a model out of one django app and into a new one?

I have a django app with four models in it. I realize now that one of these models should be in a separate app. I do have south installed for migrations, but I don't think this is something it can handle automatically. How can I migrate one of the models out of the old app into a new one? Also, keep in mind that I'm going to need this t...

django and south migration with conflicts (0007_two ... and 0007_one) how to solve ?

Hi I want to use south in my django project as migration tool, but I have problem with using south in multiuser scenario: two guys working in same time and create on diffrent machines two migrations with same number on first PC: 0007_extend_lizard.py on second PC: 0007_swap_name_adopter.py in this case i can run ./manage migrate --...

reverse engineer mysql database to create django app

I basically want to take an existing mysql database structure created and used by a php app (codeigniter framework) and reverse engineer it to a django app. is there some tool to do this? south migrations maybe? ...

Currently using Django "Evolution", is "South" better and worth switching?

I'm currently using Django evolutions to manage my product's database evolutions. It's not perfect but I've learned to live with its flaws. For instance, I always have to copy my production database to test before moving out a new schema because the "evolve" command cannot always evolve a database that was changed in several small migr...

Using south to refactor a Django model with inheritence

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.Ch...

How to ensure database changes can be easily moved over DVCS using django

Overview I'm building a website in django. I need to allow people to begin to add flatpages, and set some settings in the admin. These changes should be definitive, since that information comes from the client. However, I'm also developing the backend, and as such will am creating and migrating tables. I push these changes to the hu...

How do I migrate data from one model to another using South in Django?

I created a Django app that had its own internal voting system and a model called Vote to track it. I want to refactor the voting system into its own app so I can reuse it. However, the original app is in production and I need to create a data migration that will take all the Votes and transplant them into the separate app. How can I ...

south. migrate entire database

how can i migrate entiry db at one step? south`s startmigration command can work only with single application ...

What is the best approach to change primary keys in an existing Django app?

Hello, I have an application which is in BETA mode. The model of this app has some classes with an explicit primary_key. As a consequence Django use the fields and doesn't create an id automatically. class Something(models.Model): name = models.CharField(max_length=64, primary_key=True) I think that it was a bad idea (see http://...

How to add an Admin class to a model after syncdb?

I added some models in my models.py and I want to add an admin class to use a wysiwyg-editor in text-fields. Well, I know that Django itself doesn't support migrations and I've used South, but it doesn't work either. South doesn't "see" the change. Could...

Django migrations--is it possible to use South in the middle of the project?

I already started a project, and the models are all synced and everything. ...

Django South Foreign Keys referring to pks with Custom Fields

I'm working with a legacy database which uses the MySQL big int so I setup a simple custom model field to handle this: class BigAutoField(models.AutoField): def get_internal_type(self): return "BigAutoField" def db_type(self): return 'bigint AUTO_INCREMENT' # Note this won't work with Oracle. This works fine w...

django + south + python: strange behavior when using a text string received as a parameter in a function

Hello, this is my first question. I'm trying to execute a SQL query in django (south migration): from django.db import connection # ... class Migration(SchemaMigration): # ... def transform_id_to_pk(self, table): try: db.delete_primary_key(table) except: pass finally: ...

Problems with South/Django: not recognizing the Django App

I've got a Django project on my machine and when I try to use South to migrate the data schema, I get several odd errors. Example: $ python manage.py convert_to_south thisLocator /Library/Python/2.6/site-packages/registration/models.py:4: DeprecationWarning: the sha >module is deprecated; use the hashlib module instead import...

Django 1.2 + South 0.7 + django-annoying's AutoOneToOneField leads to TypeError: 'LegacyConnection' object is not iterable

I'm using Django 1.2 trunk with South 0.7 and an AutoOneToOneField copied from django-annoying. South complained that the field does not have rules defined and the new version of South no longer has an automatic field type parser. So I read the South documentation and wrote the following definition (basically an exact copy of the OneToOn...

Error 1005 when adding a foreign key constraint on mysql table

Hello, I have a problem when upgrading a django and mysql app with south. I've tried to make a sql-based upgrade with the code generated by the django sqlall command and I have a similar problem. Here is the sql code: CREATE TABLE `programmations_basissupport` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `value` numer...

South migration error: NoMigrations exception for django.contrib.auth

I have been using South on my project for a while, but I recently did a huge amount of development and changed development machine and I think something messed up in the process. The project works fine, but I can't apply migrations. Whenever I try to apply a migration I get the following traceback: danpalmer:pest Dan$ python manage.py m...

Easiest way to rename a model using Django/South?

Hi everyone, I've been hunting for an answer to this on South's site, google, and SO, but couldn't find a simple way to do this. I want to rename a Django model using South. Say you have the following: class Foo(models.Model): name = models.CharField() class FooTwo(models.Model): name = models.CharField() foo = models.Fo...

Django South - table already exists

I am trying to get started with South. I had an existing database. I added South (syncdb, schemamigration --initial). I updated models.py to add a field. I ran ./manage.py schemamigration myapp --auto It seemed to find the field and said I could apply this with ./manage.py migrate myapp Doing that gave the error: django.db.utils...

how Update column data type in Django...

Hi All, I have new to python and django I am creating poll application and in that application after creating models poll and choice using "South". I want to changer the length of question field from 200 to 300 but I am not able to achieve it even using south as well. I have run python manage.py schemamigration polls --initial command ...