'Test AlterField operation with an index to ensure indexes created via
Meta.indexes don\'t get dropped with sqlite3 remake.'

def test_alter_field_with_index(self):

    project_state = self.set_up_test_model('test_alflin', index=True)
    operation = migrations.AlterField('Pony', 'pink', models.IntegerField(null=True))
    new_state = project_state.clone()
    operation.state_forwards('test_alflin', new_state)
    self.assertColumnNotNull('test_alflin_pony', 'pink')
    with connection.schema_editor() as editor:
        operation.database_forwards('test_alflin', editor, project_state, new_state)
    self.assertIndexExists('test_alflin_pony', ['pink'])
    with connection.schema_editor() as editor:
        operation.database_backwards('test_alflin', editor, new_state, project_state)
    self.assertIndexExists('test_alflin_pony', ['pink'])
