Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Postgres migrate error #14

Open
avelino opened this issue Nov 30, 2014 · 0 comments
Open

Postgres migrate error #14

avelino opened this issue Nov 30, 2014 · 0 comments

Comments

@avelino
Copy link

avelino commented Nov 30, 2014

In postgresql you need to use depends_on[1], to which he rode in the correct order, exemple[2].

(bienv)root@falconeit:/nucleo/bienv# python manage.py syncdb --migrate                                                                                                                        
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): no 
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Migrating...
Running migrations for data_drivers:
 - Migrating forwards to 0039_auto__add_field_sourcedataversion_elements.
 > data_drivers:0001_initial
 > data_drivers:0002_auto__add_field_sourceshape_new_projection
 > data_drivers:0003_auto__add_shapefilecolumn
 > data_drivers:0004_auto__add_field_shapefilecolumn_data_type
 > data_drivers:0005_auto__add_field_source_published
 > data_drivers:0006_auto__add_field_spreadsheetcolumn_skip_regex__add_field_spreadsheetcol
 > data_drivers:0007_auto__add_sourcedatabase
FATAL ERROR - The following SQL query failed: ALTER TABLE "data_drivers_sourcedatabase" ADD CONSTRAINT "database_connection_id_refs_id_507b6ea7" FOREIGN KEY ("database_connection_id") REFERENCES "db_drivers_databaseconnection" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "db_drivers_databaseconnection" does not exist

Error in migration: data_drivers:0007_auto__add_sourcedatabase
DatabaseError: relation "db_drivers_databaseconnection" does not exist

[1] http://south.readthedocs.org/en/latest/dependencies.html
[2] https://github.com/opps/opps/blob/stable/0.2.x/opps/containers/migrations/0001_initial.py#L14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant