Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23009 closed Bug (fixed)

migrations may generate too long identifiers for the database

Reported by: Thom Wiggers Owned by: nobody
Component: Migrations Version: 1.7-rc-1
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Similar to #1820, I am getting 'too long identifier' errors when using Django
1.7rc1 migrations.

See this trace:

  [snip]
  Applying gamemaker.0001_initial...Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
    output = self.handle(*args, **options)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 160, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/migrations/executor.py", line 62, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/migrations/executor.py", line 96, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/schema.py", line 82, in __exit__
    self.execute(sql)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/schema.py", line 98, in execute
    cursor.execute(sql, params)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 128, in execute
    return self.cursor.execute(query, args)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/thom/git/cachegame/env/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.OperationalError: (1059, "Identifier name 'gamepartrequirement_id_refs_gamepartrequirement_id_73910b1f79e0e715' is too long")

When I rm -r gamemaker/migrations, everything goes well when I run ./migrate.py syncdb.

I'm using MySQL-python 1.2.5.

Change History (3)

comment:1 by Tim Graham, 10 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Andrew Godwin <andrew@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 7dacc6ae4657ecc18bd92a94b50950871f914168:

Fixed #23009: Shorten FK identifiers in add_field and make consistent

comment:3 by Andrew Godwin <andrew@…>, 10 years ago

In 88135a8cf7d587b88e47f1223cf01c7698b52b74:

[1.7.x] Fixed #23009: Shorten FK identifiers in add_field and make consistent

Note: See TracTickets for help on using tickets.
Back to Top