# Generated by Django 3.1.8 on 2021-04-22 19:40


# Disclaimer
# ----------
#
# Copyright (C) 2021 Helmholtz-Zentrum Hereon
# Copyright (C) 2020-2021 Helmholtz-Zentrum Geesthacht
#
# This file is part of django-academic-community and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the EUROPEAN UNION PUBLIC LICENCE v. 1.2 or later
# as published by the European Commission.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# EUPL-1.2 license for more details.
#
# You should have received a copy of the EUPL-1.2 license along with this
# program. If not, see https://www.eupl.eu/.


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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("members", "0001_initial"),
        ("institutions", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="academicorganization",
            name="contact",
            field=models.ForeignKey(
                blank=True,
                help_text="The central contact person.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="organization_contact",
                to="members.communitymember",
            ),
        ),
        migrations.AddField(
            model_name="academicorganization",
            name="members",
            field=models.ManyToManyField(
                help_text="Members in this organization",
                through="institutions.AcademicMembership",
                to="members.CommunityMember",
            ),
        ),
        migrations.AddField(
            model_name="academicmembership",
            name="member",
            field=models.ForeignKey(
                help_text="The members profile.",
                on_delete=django.db.models.deletion.CASCADE,
                to="members.communitymember",
            ),
        ),
        migrations.AddField(
            model_name="academicmembership",
            name="organization",
            field=models.ForeignKey(
                help_text="The academic organization (instutition, department or unit).",
                on_delete=django.db.models.deletion.CASCADE,
                to="institutions.academicorganization",
            ),
        ),
        migrations.AddField(
            model_name="unit",
            name="parent_department",
            field=models.ForeignKey(
                help_text="The department of the unit.",
                on_delete=django.db.models.deletion.CASCADE,
                to="institutions.department",
            ),
        ),
        migrations.AddField(
            model_name="institution",
            name="city",
            field=models.ForeignKey(
                blank=True,
                help_text="City of the Institution.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="institutions.city",
            ),
        ),
        migrations.AddField(
            model_name="department",
            name="parent_institution",
            field=models.ForeignKey(
                help_text="The research institution of this department.",
                on_delete=django.db.models.deletion.CASCADE,
                to="institutions.institution",
            ),
        ),
    ]
