Hello!
I tried to run
./manage.py test for the first time and I got the following error:
DatabaseError: (1071, 'Specified key was too long; max key length is 767 bytes')
Looking at the log in MySQL, it appears to be caused by this statement:
CREATE TABLE `auth_customuser` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`password` varchar(128) NOT NULL,
`last_login` datetime NOT NULL,
`email` varchar(255) NOT NULL UNIQUE,
`is_active` bool NOT NULL,
`is_admin` bool NOT NULL,
`date_of_birth` date NOT NULL
)
So the email field of varchar(255) is causing me to go over the single-column index of 767 bytes in InnoDB when the charset is utf8mb4, that part I understand.
Why is it trying to create this
auth_customuser table anyways though? It doesn't exist in my application normally. The
email field on my
auth_user table is varchar(75) so no error from that, not sure why it's a different length there though.
To get around the issue temporarily I set the database engine to sqlite, but I'd like to be able to use MySQL for the tests, since that's what my application normally uses.
Thanks in advance!