

def forwards(self, orm):
    db.start_transaction()
    cursor = connection.cursor()
    cursor.execute('select * from zorna_forms_form')
    qs = cursor.fetchall()
    db.create_table('zorna_forms_form_action_urls', (('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('form', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forms.FormsForm'], null=True)), ('url', self.gf('django.db.models.fields.CharField')(max_length=255))))
    db.send_create_signal('forms', ['FormsFormActionUrl'])
    db.create_table('zorna_forms_form_actions', (('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('form', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forms.FormsForm'], null=True)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), ('object_id', self.gf('django.db.models.fields.IntegerField')())))
    db.send_create_signal('forms', ['FormsFormAction'])
    db.create_table('zorna_forms_form_action_messages', (('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('form', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['forms.FormsForm'], null=True)), ('message', self.gf('django.db.models.fields.TextField')())))
    db.send_create_signal('forms', ['FormsFormActionMessage'])
    db.delete_column('zorna_forms_form', 'response')
    from django.contrib.contenttypes.management import update_contenttypes
    from django.db.models import get_app, get_models
    update_contenttypes(get_app('forms'), get_models())
    if (not db.dry_run):
        db.commit_transaction()
        db.start_transaction()
        ct = orm['contenttypes.ContentType'].objects.get(app_label='forms', model='formsformactionmessage')
        for form in qs:
            rep = orm.FormsFormActionMessage(message=form[13], form_id=form[0])
            rep.save()
            orm.FormsFormAction.objects.create(form_id=form[0], object_id=rep.pk, content_type=ct)
    db.commit_transaction()

dataset/ETHPy150Open zorna/zorna/zorna/forms/migrations/0009_added_form_actions.py Migration.forwards/original