# Generated by Django 2.1.2 on 2020-03-15 04:49

from django.db import migrations, models
import django.db.models.deletion

def switch_to_post(apps, schema_editor):
    OldCable = apps.get_model('login', 'OldCable')
    NewCable = apps.get_model('login', 'NewCable')
    for un in OldCable.objects.all():
        un.delete()

def switch_to_nopost(apps, schema_editor):
    OldCable = apps.get_model('login', 'OldCable')
    NewCable = apps.get_model('login', 'NewCable')

    for un in NewCable.objects.all():
        un.delete()

class Migration(migrations.Migration):

    dependencies = [
        ('login', '0011_auto_20200315_1322'),
    ]

    operations = [
       migrations.RenameModel('Cable', 'OldCable'),
        migrations.CreateModel(
            name="NewCable",
            fields=[
                ('rentalitem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True,serialize=False, to='login.RentalItem')),
                ('borrowed_by', models.OneToOneField('login.Student', related_name='ca', null=True, blank=True, on_delete=models.DO_NOTHING)),
                
            ],
            bases=('login.RentalItem',),
        ),
        migrations.DeleteModel('OldCable'),
        migrations.RenameModel('NewCable', 'Cable')
    ]
