1
0
mirror of https://github.com/django/django.git synced 2025-03-13 19:00:45 +00:00

Fixed #35015 -- Updated MySQL notes in migrations topic.

This commit is contained in:
Nicolas Lupien 2023-12-06 12:58:59 -05:00 committed by Mariusz Felisiak
parent 47033bfd48
commit d4c583682e

View File

@ -77,16 +77,17 @@ meaning that if a migration fails to apply you will have to manually unpick
the changes in order to try again (it's impossible to roll back to an the changes in order to try again (it's impossible to roll back to an
earlier point). earlier point).
In addition, MySQL will fully rewrite tables for almost every schema operation MySQL 8.0 introduced significant performance enhancements for
and generally takes a time proportional to the number of rows in the table to `DDL operations`_, making them more efficient and reducing the need for full
add or remove columns. On slower hardware this can be worse than a minute per table rebuilds. However, it cannot guarantee a complete absence of locks or
million rows - adding a few columns to a table with just a few million rows interruptions. In situations where locks are still necessary, the duration of
could lock your site up for over ten minutes. these operations will be proportionate to the number of rows involved.
Finally, MySQL has relatively small limits on name lengths for columns, tables Finally, MySQL has a relatively small limit on the combined size of all columns
and indexes, as well as a limit on the combined size of all columns an index an index covers. This means that indexes that are possible on other backends
covers. This means that indexes that are possible on other backends will will fail to be created under MySQL.
fail to be created under MySQL.
.. _DDL operations: https://dev.mysql.com/doc/refman/en/innodb-online-ddl-operations.html
SQLite SQLite
------ ------