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!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23d63241-40b6-4244-91c4-7f3e5495baba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to