Opened 9 years ago
Closed 9 years ago
#27441 closed Cleanup/optimization (fixed)
MySQL backend output for 'DROP COLUMN' uses undocumented SQL
| Reported by: | Adam Johnson | Owned by: | Adam Johnson |
|---|---|---|---|
| Component: | Migrations | Version: | 1.10 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Django's default SchemaEditor outputs DROP COLUMN ... CASCADE. When inspecting the SQL for a migration I saw this and wondered what the CASCADE means - it's not documented on MySQL ( http://dev.mysql.com/doc/refman/5.7/en/alter-table.html ), but I discovered it is a no-op added for compatibility with e.g. postgres where it does mean something. I added this to the MariaDB documentation ( https://mariadb.com/kb/en/mariadb/alter-table/ ) because it's editable, but it's not going to get added to the MySQL documentation any time soon.
Since it's potentially confusing and a no-op, I think Django shouldn't output CASCADE on MySQL.
Change History (3)
comment:1 by , 9 years ago
| Has patch: | set |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 9 years ago
| Triage Stage: | Unreviewed → Ready for checkin |
|---|
https://github.com/django/django/pull/7478