python manage py migrate home pilgrim venv venv-gallup local lib pytho

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$ python manage.py migrate
/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/sorl/thumbnail/helpers.py:5: DeprecationWarning: django.utils.simplejson is deprecated; use json instead.
from django.utils import simplejson
Running migrations for action_user:
- Migrating forwards to 0004_auto__add_field_user_is_working.
> action_user:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE "action_user_user" ("id" serial NOT NULL PRIMARY KEY, "password" varchar(128) NOT NULL, "last_login" timestamp with time zone NOT NULL, "is_superuser" boolean NOT NULL, "first_name" varchar(30) NOT NULL, "last_name" varchar(30) NOT NULL, "email" varchar(75) NOT NULL, "username" varchar(30) NOT NULL UNIQUE, "is_staff" boolean NOT NULL, "is_active" boolean NOT NULL, "date_joined" timestamp with time zone NOT NULL, "skype" varchar(150) NULL, "phone" varchar(10) NULL)
The error was: relation "action_user_user" already exists
Error in migration: action_user:0001_initial
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
ignore_ghosts = ignore_ghosts,
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 254, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 329, in migrate_many
result = self.migrate(migration, database)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
result = self.run(migration, database)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
return self.run_migration(migration, database)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
migration_function()
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in <lambda>
return (lambda: direction(orm))
File "/home/pilgrim/PycharmProjects/gallup/apps/action_user/migrations/0001_initial.py", line 25, in forwards
('phone', self.gf('snippets.models.fields.PhoneField')(max_length=10, null=True, blank=True)),
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/db/generic.py", line 47, in _cache_clear
return func(self, table, *args, **opts)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/db/generic.py", line 361, in create_table
"columns": ', '.join([col for col in columns if col]),
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
cursor.execute(sql, params)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/pilgrim/venv/venv-gallup/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/pilgrim/venv/venv-gallup/local/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 "action_user_user" already exists