micahmanquen / django-ldap-groups

Automatically exported from code.google.com/p/django-ldap-groups
0 stars 0 forks source link

generated sql from templates is wrong #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install django-ldap-groups
2. Run python manage.py syncdb

What is the expected output? 
It creates ldap-groups tables

What do you see instead?
ERROR 1170 (42000): BLOB/TEXT column 'org_unit' used in key specification 
without a key length

Running manage.py sql ldap_groups outputs 
CCREATE TABLE `ldap_groups_ldapgroup` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `make_staff` bool NOT NULL,
    `make_superuser` bool NOT NULL,
    `org_unit` longtext NOT NULL UNIQUE
)
;

The problem is the unique index on a longtext the problem is described here
http://www.mydigitallife.info/2007/07/09/mysql-error-1170-42000-blobtext-
column-used-in-key-specification-without-a-key-length/
A workaround is to just remove the unique constraint and run the sql 
manually.  Django will still check for uniqueness at the model level.

Original issue reported on code.google.com by dmbs...@gmail.com on 20 Apr 2010 at 3:57

GoogleCodeExporter commented 8 years ago
Duplicate of issue 1, fixed in trunk.

Original comment by tphern...@gmail.com on 20 Apr 2010 at 5:34