EvilLogitech/python-project-52

View on GitHub
task_manager/tasks/migrations/0005_labelsrelations_task_labels.py

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# Generated by Django 4.2.7 on 2023-11-26 17:50

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


class Migration(migrations.Migration):

    dependencies = [
        ('labels', '0001_initial'),
        ('tasks', '0004_remove_task_labels'),
    ]

    operations = [
        migrations.CreateModel(
            name='LabelsRelations',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lables', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='labels.label')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasks.task')),
            ],
        ),
        migrations.AddField(
            model_name='task',
            name='labels',
            field=models.ManyToManyField(through='tasks.LabelsRelations', to='labels.label'),
        ),
    ]