Opened 5 years ago
Closed 5 years ago
#30773 closed New feature (wontfix)
Support Algorithm parameter on MySQL migrations.
Reported by: | mklauber | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | mysql |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
See: https://mysqlserverteam.com/mysql-8-0-innodb-now-supports-instant-add-column/
Mysql now supports (as of 8.0) a new ALGORITHM = INSTANT, that prevents long running DDL statements. It would be useful to be able to define this on migrations, to prevent table locking, without having to manually write every migration. Perhaps as an option on the database in the DATABASES setting dict?
Change History (2)
comment:2 by , 5 years ago
Component: | Migrations → Database layer (models, ORM) |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
I totally agree with Simon.
Note:
See TracTickets
for help on using tickets.
MySQL will use the best algorithm available by default if possible (
INPLACE
orINSTANT
) so this option will only make the operation crash if the specified algorithm is not available. Given MySQL doesn't support transactional DDL this has the potential to cause more harm than good if a migration has multiple operations IMO.I guess we could add support for
algorithm
to MySQL schema editor but as I mentioned above MySQL already picks the best algorithm it can and I can't see a reason for usingCOPY
orINPLACE
whenINSTANT
is supported.Finally given we added
AddIndexConcurrently
tocontrib.postgres
this would probably belong indjango-mysql
.