Django south from MySQL to postgresql -


I had started using MySQL in one of my apps before and now I was thinking of moving from MySQL to PostgreSQL I am

I have established South for migration. When I set up a new DB in postgre, then I successfully synced my application and completely stopped in one of my previous migration.

  & gt; Project: 0056_auto__chg_field_project_project_length Traceback (the most recent call final): File "./manage.py", at line 11, in the & lt; Module & gt; Execute_manager (setting) "/Users/ApPeL/.virtualenvs/fundedbyme.com/lib/python2.7/site-packages/django/core/management/__init__.py" file execute_manager utility.execute, line 438, (file) "/Users/ApPeL/.virtualenvs/fundedbyme.com/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, self.fetch_command (subcommand) .run_from_argv (performed manually. argv) file "/Users/ApPeL/.virtualenvs/fundedbyme.com/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute (* args, * * Options .__ dict__) File "/ User / APPL / VirtualEnge / Funded Beam / Lib / Python 2.7 / Site-Package / Dajang / Core / Management / Bijap", Line 220, Model In filing output = self.handle (* Arges, ** options) file "/ Library / Python 7.2 / site-packages / South / Management / Order / Magetep", line 105, handle ignore_ghosts = ignore_ghosts, file "/ Library / Python 2/7 / Site-packages / south / migration / __ init__.py ", line 1 9 1, migrate_app success = migrator.migrate_many (target, workspace, database), file" /Library/Python/2.7/site -packages / south / migrations / migrators.py ", line migrator.__ class __ in line 221 migrate_many results. Migrate_many (migrator, target, migration, database) file "/ Library / Python /2.7/site-packages/south/migration/migrators.py", line 292, migrate_many result = self.migrate (migration, database) file "/ Library / python 2/7 / site-package / southwest / migration pi ", line 125, migrated result = self.run (migration) file" / library / python 2/7 / site-package / south / migration / mgrakats.py ", Line 99, run itself in return. Rune_migration file" / library / legs "/ Library / Python 2/7 / site-packages / south / migrations / migrars" in the file, "Line 2/7 / site-package / South / Migration / Magatrrosors", line 81, Run-Migration migration_function () file, line 57 , In & lt; Lambda & gt; Return (lambda: direction (ORM)), file "/Users/ApPeL/Sites/Django/fundedbyme/project/migrations/0056_auto__chg_field_project_project_length.py", line 12 forwards db.alter_column ( 'project_project', self 'project_length'. Gf ('Django.db.models.fields.IntegerField') ()) file "/ library / Python 2/2 / site-package / south / db / genericap", in line 382, ​​alter_column flatten (value), file "/ Library / Python 2/7 / Site-Packages / South / DB / Granacap", line 150, executed cursor. Akskyut (SQL, Params) file "/ Users / Apeepiiel /. Warchualanvis / Fndedbime / lib / python2.7 / site-packages / Django / db / backend / Postgresql_psycopg2 / Basekpy", return to perform in line 44, self.cursor .execute (query, args) django.db.utils.DatabaseError: column "project_length" can not   

You work the current migration in such a way:

  1. Replace the column "project_length" in another way.

    This is broken because you change Are doing That's not supported by PostgreSQL.

    You have to fix your stay, you can change it in the following migration (this will work, but it can possibly be simpler): < Ol>

  2. Type another project Project_LANG_TTP that you want to do in project_lamp and some default values.
  3. to create data migrations from project_length to project_length project_lenght_tmp (Data migration in South Docs Switch to).
  4. Delete the column project.
  5. Rename the column for project_lamp project_length_tmp

    Complex complex migration but it has two main powers: 1. It will work on all databases. 2. It is compatible with your old migration, so that you can override the old migration (file change) and it will be fine.

    Approach 2

    Another approach to your problem is to simply remove all your migration and start from scratch. If you have only one deployment of your project then it will work fine for you.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -