# Generated by Django 3.2.17 on 2023-02-03 09:37

import django.db.models.deletion
import django.db.models.manager
import django_handleref.models
import django_peeringdb.models.abstract
from django.db import migrations, models

import peeringdb_server.models


class Migration(migrations.Migration):
    dependencies = [
        ("peeringdb_server", "0106_user_primary_org"),
    ]

    operations = [
        migrations.CreateModel(
            name="Campus",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "status",
                    models.CharField(blank=True, max_length=255, verbose_name="Status"),
                ),
                (
                    "created",
                    django_handleref.models.CreatedDateTimeField(
                        auto_now_add=True, verbose_name="Created"
                    ),
                ),
                (
                    "updated",
                    django_handleref.models.UpdatedDateTimeField(
                        auto_now=True, verbose_name="Updated"
                    ),
                ),
                ("version", models.IntegerField(default=0)),
                (
                    "name",
                    models.CharField(
                        max_length=255, unique=True, verbose_name="Campus Name"
                    ),
                ),
                (
                    "name_long",
                    models.CharField(
                        blank=True, max_length=255, null=True, verbose_name="Long Name"
                    ),
                ),
                (
                    "aka",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="Also Known As",
                    ),
                ),
                (
                    "website",
                    django_peeringdb.models.abstract.URLField(
                        blank=True, max_length=255, null=True, verbose_name="Website"
                    ),
                ),
                (
                    "org",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="campus_set",
                        to="peeringdb_server.organization",
                        verbose_name="Organization",
                    ),
                ),
            ],
            options={
                "verbose_name": "Campus",
                "verbose_name_plural": "Campuses",
                "db_table": "peeringdb_campus",
                "abstract": False,
            },
            bases=(peeringdb_server.models.ProtectedMixin, models.Model),
            managers=[
                ("handleref", django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name="facility",
            name="campus",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="fac_set",
                to="peeringdb_server.campus",
            ),
        ),
    ]
