#27676: MariaDB 10.2 supports defaults for text columns
-------------------------------------+-------------------------------------
     Reporter:  Adam Johnson         |                    Owner:  Adam
                                     |  Johnson
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tobias Krönke):

 Could we skip the default if it's the empty string for MySQL? Explicitly
 setting the empty string prevents the `ALGORITHM=INSTANT` magic from
 adding the column without table copying. This would be a huge performance
 improvement for many users. I have seen so many issues where people would
 like to add new columns to very large tables efficiently. MySQL has this
 now built-in, but django prevents it by redudantly specifying the empty
 string as default. This is enough and makes the instant algorithm work:

 {{{
 ALTER TABLE `<table name>` ADD COLUMN `<column name>` longtext NOT NULL;
 }}}


 Same for CHAR and VARCHAR.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018c1593e0c8-a6240b1a-26b9-4bc3-bdf0-12a50ccb87fb-000000%40eu-central-1.amazonses.com.

Reply via email to