Skip to content

Problems with migrations #32

@paulocoutinhox

Description

@paulocoutinhox

Hi,

Im trying execute migrations to MySQL but get this errors:

Applying toosimpleq.0004_auto_20200507_1339...Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/homebrew/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 76, in execute
    return self.cursor.execute(query, args)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/connections.py", line 261, in query
    _mysql.connection.query(self, query)
MySQLdb.OperationalError: (1071, 'Specified key was too long; max key length is 3072 bytes')

and

Applying toosimpleq.0011_workerstatus...Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in _execute
    return self.cursor.execute(sql)
  File "/opt/homebrew/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 76, in execute
    return self.cursor.execute(query, args)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
  File "/opt/homebrew/lib/python3.10/site-packages/MySQLdb/connections.py", line 261, in query
    _mysql.connection.query(self, query)
MySQLdb.OperationalError: (1071, 'Specified key was too long; max key length is 3072 bytes')

The problems is related with this:

field=models.CharField(max_length=1024, unique=True),

Can you fix this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions