Django should allow DEFAULT for these columns when on MariaDB 10.2+.
--
Ticket URL: <https://code.djangoproject.com/ticket/27676>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Bug => New feature
* stage: Unreviewed => Someday/Maybe
Comment:
First some consensus is needed about whether Django
[https://groups.google.com/d/topic/django-
developers/31j1dNOZ7zc/discussion should officially support MariaDB].
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:1>
Comment (by Adam Chainz):
Thanks, I missed that thread, commented
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:2>
* has_patch: 0 => 1
* stage: Someday/Maybe => Ready for checkin
Comment:
[https://github.com/django/django/pull/7778 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:3>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
On the PR, Adam said, "I was thinking of forming a better plan around
MariaDB first."
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:4>
Comment (by felixxm):
Django 3.0 will officially support MariaDB 10.1+. I think it's time to
change this feature flag. Adam, can you resubmit your patch?
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:5>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"7da6a28a447dc0db2a2c6ef31894094eb968f408" 7da6a28a]:
{{{
#!CommitTicketReference repository=""
revision="7da6a28a447dc0db2a2c6ef31894094eb968f408"
Fixed #27676 -- Allowed BLOB/TEXT defaults on MariaDB 10.2.1+.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:7>
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>
* status: closed => new
* resolution: fixed =>
Comment:
PR added: https://github.com/django/django/pull/17539
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
Please open a new ticket rather than reopening an old one.
--
Ticket URL: <https://code.djangoproject.com/ticket/27676#comment:10>