<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-06 21:15
from __future__ import unicode_literals

from django.db import migrations


def products2offers(apps, schema_editor):
    Product = apps.get_model("products", "Product")
    Offer = apps.get_model("offers", "Offer")
    for product in Product.objects.all():
        Offer.objects.create(
            store=product.store,
            external_id=product.external_id,
            name=product.name,
            url=product.url,
            price=product.price,
            data=product.data,
        )


class Migration(migrations.Migration):

    dependencies = [
        ('offers', '0001_initial'),
        ('products', '0003_auto_20160601_2019'),
    ]

    operations = [
        migrations.RunPython(products2offers),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-06 21:15
from __future__ import unicode_literals

from django.db import migrations


def products2offers(apps, schema_editor):
    Product = apps.get_model("products", "Product")
    Offer = apps.get_model("offers", "Offer")
    for product in Product.objects.all():
        Offer.objects.create(
            store=product.store,
            external_id=product.external_id,
            name=product.name,
            url=product.url,
            price=product.price,
            data=product.data,
        )


class Migration(migrations.Migration):

    dependencies = [
        ('offers', '0001_initial'),
        ('products', '0003_auto_20160601_2019'),
    ]

    operations = [
        migrations.RunPython(products2offers),
    ]
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-06 21:15