mirror of
https://github.com/django/django.git
synced 2024-11-30 07:06:18 +01:00
Fixed #27441 -- Improved SQL for 'DROP COLUMN' on MySQL
'CASCADE' is an undocumented no-op in MySQL, so to avoid confusion Django no longer outputs it.
This commit is contained in:
parent
d1dbaeaadb
commit
c7dddc01d6
@ -9,6 +9,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL"
|
||||
sql_alter_column_not_null = "MODIFY %(column)s %(type)s NOT NULL"
|
||||
sql_alter_column_type = "MODIFY %(column)s %(type)s"
|
||||
|
||||
# No 'CASCADE' which works as a no-op in MySQL but is undocumented
|
||||
sql_delete_column = "ALTER TABLE %(table)s DROP COLUMN %(column)s"
|
||||
|
||||
sql_rename_column = "ALTER TABLE %(table)s CHANGE %(old_column)s %(new_column)s %(type)s"
|
||||
|
||||
sql_delete_unique = "ALTER TABLE %(table)s DROP INDEX %(name)s"
|
||||
|
Loading…
Reference in New Issue
Block a user