Skip to content

Instantly share code, notes, and snippets.

@collinanderson
Created February 9, 2015 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collinanderson/9df14bbeed50c0000ea6 to your computer and use it in GitHub Desktop.
Save collinanderson/9df14bbeed50c0000ea6 to your computer and use it in GitHub Desktop.
collin@anakin:~/testcustomuser$ PYTHONPATH=~/django1.9 python3 ./manage.py migrate
SET SQL_AUTO_IS_NULL = 0 None
SET SQL_AUTO_IS_NULL = 0 None
SHOW FULL TABLES None
CREATE TABLE `django_migrations` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `app` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `applied` datetime NOT NULL) None
SELECT engine FROM information_schema.tables WHERE table_name = %s ['django_migrations']
SELECT `django_migrations`.`app`, `django_migrations`.`name` FROM `django_migrations` ()
Operations to perform:
Apply all migrations: auth, sessions, admin, contenttypes
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial...SHOW FULL TABLES None
CREATE TABLE `django_content_type` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `name` varchar(100) NOT NULL, `app_label` varchar(100) NOT NULL, `model` varchar(100) NOT NULL) None
SELECT engine FROM information_schema.tables WHERE table_name = %s ['django_content_type']
ALTER TABLE `django_content_type` ADD CONSTRAINT `django_content_type_app_label_77d04cd648affd20_uniq` UNIQUE (`app_label`, `model`) []
SHOW FULL TABLES None
INSERT INTO `django_migrations` (`app`, `name`, `applied`) VALUES (%s, %s, %s) ['contenttypes', '0001_initial', '2015-02-09 18:29:58.227579']
OK
Applying admin.0001_initial...SHOW FULL TABLES None
CREATE TABLE `django_admin_log` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `action_time` datetime NOT NULL, `object_id` longtext NULL, `object_repr` varchar(200) NOT NULL, `action_flag` smallint UNSIGNED NOT NULL, `change_message` longtext NOT NULL, `content_type_id` integer NULL, `user_id` integer NOT NULL) None
SELECT engine FROM information_schema.tables WHERE table_name = %s ['django_admin_log']
ALTER TABLE `django_admin_log` ADD CONSTRAINT `djang_content_type_id_23aa5bc13e854747_fk_django_content_type_id` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) []
ALTER TABLE `django_admin_log` ADD CONSTRAINT `django_admin_log_user_id_63807bf4c4d793fa_fk_app_myuser_id` FOREIGN KEY (`user_id`) REFERENCES `app_myuser` (`id`) []
Traceback (most recent call last):
File "/home/collin/django1.9/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/home/collin/django1.9/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 219, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/connections.py", line 38, in defaulterrorhandler
raise errorvalue
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 205, in execute
r = self._query(query)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 372, in _query
rowcount = self._do_query(q)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 336, in _do_query
db.query(q)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/connections.py", line 282, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1005, "Can't create table 'testcustomuser.#sql-2f36_79ac' (errno: 150)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/collin/django1.9/django/core/management/__init__.py", line 330, in execute_from_command_line
utility.execute()
File "/home/collin/django1.9/django/core/management/__init__.py", line 322, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/collin/django1.9/django/core/management/base.py", line 347, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/collin/django1.9/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/home/collin/django1.9/django/core/management/commands/migrate.py", line 189, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
File "/home/collin/django1.9/django/db/migrations/executor.py", line 94, in migrate
self.apply_migration(states[migration], migration, fake=fake)
File "/home/collin/django1.9/django/db/migrations/executor.py", line 130, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/collin/django1.9/django/db/backends/base/schema.py", line 87, in __exit__
self.execute(sql)
File "/home/collin/django1.9/django/db/backends/base/schema.py", line 107, in execute
cursor.execute(sql, params)
File "/home/collin/django1.9/django/db/backends/utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/collin/django1.9/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/home/collin/django1.9/django/db/utils.py", line 92, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/collin/django1.9/django/utils/six.py", line 658, in reraise
raise value.with_traceback(tb)
File "/home/collin/django1.9/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/home/collin/django1.9/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 219, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/connections.py", line 38, in defaulterrorhandler
raise errorvalue
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 205, in execute
r = self._query(query)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 372, in _query
rowcount = self._do_query(q)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/cursors.py", line 336, in _do_query
db.query(q)
File "/usr/local/lib/python3.4/dist-packages/MySQLdb/connections.py", line 282, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1005, "Can't create table 'testcustomuser.#sql-2f36_79ac' (errno: 150)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment