# Generated by Django 2.2.25 on 2021-12-15 12:04

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


class Migration(migrations.Migration):

    dependencies = [
        ('staff', '0013_valuestream_startrek_id'),
        ('core', '0007_location'),
        ('vacancies', '0018_fill_vacancy_touched_at'),
    ]

    operations = [
        migrations.CreateModel(
            name='VacancyOffice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('office', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vacancy_offices', to='staff.Office')),
                ('vacancy', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vacancy_offices', to='vacancies.Vacancy')),
            ],
            options={
                'unique_together': {('vacancy', 'office')},
            },
        ),
        migrations.CreateModel(
            name='VacancyLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vacancy_locations', to='core.Location')),
                ('vacancy', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='vacancy_locations', to='vacancies.Vacancy')),
            ],
            options={
                'unique_together': {('vacancy', 'location')},
            },
        ),
        migrations.AddField(
            model_name='vacancy',
            name='locations',
            field=models.ManyToManyField(related_name='vacancies', through='vacancies.VacancyLocation', to='core.Location'),
        ),
        migrations.AddField(
            model_name='vacancy',
            name='offices',
            field=models.ManyToManyField(related_name='vacancies', through='vacancies.VacancyOffice', to='staff.Office'),
        ),
    ]
