# Generated by Django 5.2.8 on 2025-12-06 15:03

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AWSCredentials",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=150)),
                ("access_key_id", models.CharField(max_length=128, unique=True)),
                ("secret_access_key", models.CharField(max_length=128)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "verbose_name": "AWS credentials",
                "verbose_name_plural": "AWS credentials",
                "ordering": ("name",),
            },
        ),
        migrations.CreateModel(
            name="LightsailDatabase",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=100)),
                ("region", models.CharField(max_length=50)),
                ("availability_zone", models.CharField(blank=True, max_length=50)),
                (
                    "secondary_availability_zone",
                    models.CharField(blank=True, max_length=50),
                ),
                ("state", models.CharField(blank=True, max_length=50)),
                ("engine", models.CharField(blank=True, max_length=50)),
                ("engine_version", models.CharField(blank=True, max_length=50)),
                ("master_username", models.CharField(blank=True, max_length=100)),
                ("backup_retention_enabled", models.BooleanField(default=False)),
                ("publicly_accessible", models.BooleanField(default=False)),
                ("arn", models.CharField(blank=True, max_length=255)),
                ("endpoint_address", models.CharField(blank=True, max_length=255)),
                ("endpoint_port", models.PositiveIntegerField(blank=True, null=True)),
                ("created_at", models.DateTimeField(blank=True, null=True)),
                ("raw_details", models.JSONField(blank=True, default=dict)),
                (
                    "credentials",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="lightsail_databases",
                        to="aws.awscredentials",
                    ),
                ),
            ],
            options={
                "verbose_name": "Lightsail database",
                "verbose_name_plural": "Lightsail databases",
                "ordering": ("name", "region"),
                "unique_together": {("name", "region")},
            },
        ),
        migrations.CreateModel(
            name="LightsailInstance",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=100)),
                ("region", models.CharField(max_length=50)),
                ("availability_zone", models.CharField(blank=True, max_length=50)),
                ("state", models.CharField(blank=True, max_length=50)),
                ("blueprint_id", models.CharField(blank=True, max_length=100)),
                ("bundle_id", models.CharField(blank=True, max_length=100)),
                ("public_ip", models.GenericIPAddressField(blank=True, null=True)),
                ("private_ip", models.GenericIPAddressField(blank=True, null=True)),
                ("arn", models.CharField(blank=True, max_length=255)),
                ("support_code", models.CharField(blank=True, max_length=100)),
                ("created_at", models.DateTimeField(blank=True, null=True)),
                ("username", models.CharField(blank=True, max_length=100)),
                ("resource_type", models.CharField(blank=True, max_length=100)),
                ("raw_details", models.JSONField(blank=True, default=dict)),
                (
                    "credentials",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="lightsail_instances",
                        to="aws.awscredentials",
                    ),
                ),
            ],
            options={
                "verbose_name": "Lightsail instance",
                "verbose_name_plural": "Lightsail instances",
                "ordering": ("name", "region"),
                "unique_together": {("name", "region")},
            },
        ),
    ]
