Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Error running manage.py migrate #52

Open
sam-ghosh opened this issue Jul 27, 2015 · 1 comment
Open

Error running manage.py migrate #52

sam-ghosh opened this issue Jul 27, 2015 · 1 comment

Comments

@sam-ghosh
Copy link

I am on South 1.0 and Django 1.6.5, and added drip as per instructions, but get an error when I do migrate

Running migrations for drip:
 - Migrating forwards to 0003_auto__add_field_drip_message_class.
 > drip:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "drip_sentdrip" ADD CONSTRAINT "user_id_refs_id_ca2f99a1" FOREIGN KEY ("user_id") REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "auth_user" does not exist

Error in migration: drip:0001_initial
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
    result = self.migrate(migration, database)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
    return self.run_migration(migration, database)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/migration/migrators.py", line 85, in run_migration
    south.db.db.execute_deferred_sql()
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/db/generic.py", line 318, in execute_deferred_sql
    self.execute(sql)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
    cursor.execute(sql, params)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/somghosh/.virtualenvs/earthmiles/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "auth_user" does not exist

My User is defined in accounts/models.py as :

class User(AbstractUser):

and in settings, I have AUTH_USER_MODEL = 'accounts.User'

@agliottone
Copy link

try my version fixed for new django https://github.com/agliottone/django-drip-2/tree/master

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

2 participants