# Generated by Django 3.2.13 on 2022-10-19 13:18

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


class Migration(migrations.Migration):
    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("baserow_enterprise", "0002_add_teams"),
    ]

    operations = [
        migrations.CreateModel(
            name="TeamSubject",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_on", models.DateTimeField(auto_now_add=True)),
                ("updated_on", models.DateTimeField(auto_now=True)),
                (
                    "subject_id",
                    models.IntegerField(
                        db_index=True, help_text="The unique subject ID."
                    ),
                ),
                (
                    "subject_type",
                    models.ForeignKey(
                        help_text="The subject type.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "team",
                    models.ForeignKey(
                        help_text="The team this subject belongs to.",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="subjects",
                        to="baserow_enterprise.team",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
