# Generated by Django 3.2.7 on 2022-01-19 20:02


# 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/.


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

delete_operations = [
    migrations.RemoveField(
        model_name="simulationperiod",
        name="topic",
    ),
    migrations.DeleteModel(
        name="CLMTopic",
    ),
    migrations.DeleteModel(
        name="CouplingComponent",
    ),
    migrations.DeleteModel(
        name="EvalData",
    ),
    migrations.DeleteModel(
        name="Forcing",
    ),
    migrations.DeleteModel(
        name="LocalBoundaryCondition",
    ),
    migrations.DeleteModel(
        name="ModelCompartmentDevelopment",
    ),
    migrations.DeleteModel(
        name="Region",
    ),
    migrations.DeleteModel(
        name="SimulationModel",
    ),
    migrations.DeleteModel(
        name="SimulationPeriod",
    ),
    migrations.DeleteModel(
        name="Usage",
    ),
]

rename_operations = [
    migrations.AlterModelTable(
        name="CLMTopic",
        table="clm_topics_clmtopic",
    ),
    migrations.AlterModelTable(
        name="CouplingComponent",
        table="clm_topics_couplingcomponent",
    ),
    migrations.AlterModelTable(
        name="EvalData",
        table="clm_topics_evaldata",
    ),
    migrations.AlterModelTable(
        name="Forcing",
        table="clm_topics_forcing",
    ),
    migrations.AlterModelTable(
        name="LocalBoundaryCondition",
        table="clm_topics_localboundarycondition",
    ),
    migrations.AlterModelTable(
        name="ModelCompartmentDevelopment",
        table="clm_topics_modelcompartmentdevelopment",
    ),
    migrations.AlterModelTable(
        name="Region",
        table="clm_topics_region",
    ),
    migrations.AlterModelTable(
        name="SimulationModel",
        table="clm_topics_simulationmodel",
    ),
    migrations.AlterModelTable(
        name="SimulationPeriod",
        table="clm_topics_simulationperiod",
    ),
    migrations.AlterModelTable(
        name="Usage",
        table="clm_topics_usage",
    ),
]


if "clm_topics" in settings.INSTALLED_APPS:
    database_operations = rename_operations
else:
    database_operations = delete_operations


class Migration(migrations.Migration):

    dependencies = [
        ("topics", "0006_clmtopic"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=delete_operations,
            database_operations=database_operations,
        ),
    ]
