# Generated by Django 3.2a1 on 2021-02-14 12:11

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("deals", "0005_contribution"),
    ]

    operations = [
        migrations.AddField(
            model_name="deal",
            name="contributors",
            field=models.ManyToManyField(
                help_text="The value of the deal will be distributed among all contributors in the accepted deals report.",
                related_name="_deals_deal_contributors_+",
                through="deals.Contribution",
                to=settings.AUTH_USER_MODEL,
                verbose_name="contributors",
            ),
        ),
        migrations.RunSQL(
            "SELECT audit_audit_table('deals_contribution');",
            "",
        ),
        migrations.RunSQL(
            """
INSERT INTO deals_contribution
(deal_id, user_id, weight)
SELECT id, owned_by_id, 100
FROM deals_deal
            """,
            "",
        ),
    ]

# Generated by Django 3.2a1 on 2021-02-14 12:11

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("deals", "0005_contribution"),
    ]

    operations = [
        migrations.AddField(
            model_name="deal",
            name="contributors",
            field=models.ManyToManyField(
                help_text="The value of the deal will be distributed among all contributors in the accepted deals report.",
                related_name="_deals_deal_contributors_+",
                through="deals.Contribution",
                to=settings.AUTH_USER_MODEL,
                verbose_name="contributors",
            ),
        ),
        migrations.RunSQL(
            "SELECT audit_audit_table('deals_contribution');",
            "",
        ),
        migrations.RunSQL(
            """
INSERT INTO deals_contribution
(deal_id, user_id, weight)
SELECT id, owned_by_id, 100
FROM deals_deal
            """,
            "",
        ),
    ]

# Generated by Django 3.2a1 on 2021-02-14 12:11 INSERT INTO deals_contribution (deal_id, user_id, weight) SELECT id, owned_by_id, 100 FROM deals_deal