﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25293	Multi-table inheritance with only related fields results in invalid migration on MySQL	Hubert Bielenia	nobody	"This report may be a duplicate of #24424 , but since the scope is somewhat different and proposed fix would not solve the issue, I decided to report it separately.

On Django 1.8.2, I have following model:
{{{
class Client(User):
    mailing_list = models.OneToOneField(SubscriberList, null=True, default=None)
}}}

Using `manage.py makemigrations` generates following operations:

{{{
 operations = [
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.RemoveField(
            model_name='client',
            name='id',
        ),
        migrations.RemoveField(
            model_name='client',
            name='user',
        ),
        migrations.AddField(
            model_name='client',
            name='mailing_list',
            field=models.OneToOneField(null=True, default=None, to='campaign.SubscriberList'),
        ),
        migrations.AddField(
            model_name='client',
            name='user_ptr',
            field=models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, default=0, serialize=False, to=settings.AUTH_USER_MODEL),
            preserve_default=False,
        ),
]
}}}

As you can see, the migration starts by removing implicit `id` and `user` fields, to later substitute them with implicit `user_ptr` field that serves both as foreign and primary key. Unfortunately, `migrations.RemoveField` uses `ALTER TABLE` statements, and this code attempts to delete all columns on the table, resulting in OperationalError with MySQL 5.8:
`django.db.utils.OperationalError: (1090, ""You can't delete all columns with ALTER TABLE; use DROP TABLE instead"")`.

It looks to me like an unwanted behaviour."	Bug	closed	Migrations	1.8	Normal	needsinfo			Accepted	0	0	0	0	0	0
