Hi Graeme, the only solution that comes to mind is overriding the 
alter_field() or _alter_field() methods on the schema 
editor: 
https://github.com/django/django/blob/stable/1.11.x/django/db/backends/base/schema.py

/Markus

On Wednesday, July 19, 2017 at 12:19:09 AM UTC+10, Graeme Perrow wrote:
>
> I am responsible for the SQL Anywhere Django driver 
> <https://github.com/sqlanywhere/sqlany-django> and I'm trying to add 
> support for Django 1.10. When I create a project and run "python manage.py 
> migrate", it executes a bunch of SQL statements but then fails when 
> altering the auth_user table to extend the username field to 150 
> characters. The problem is that the username column has a unique index on 
> it, and SQL Anywhere does not allow a column to be altered if there's an 
> index on it. I was hoping there was a feature I could enable in the 
> BaseDatabaseFeatures subclass that tells Django this but I couldn't find 
> one. I seem to be stuck.
>
> Does anyone know of a way I can tell Django to drop the unique index, 
> alter the column, and then re-create the index? Is there some sort of hook 
> that I can use to detect this case and drop / recreate the index myself?
>
> Thanks
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/805ba24c-1d9d-4f9a-97c9-7139038f2962%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to