# Generated by Django 5.2.9 on 2025-12-15 19:03

import apps.nodes.models
import apps.sigils.fields
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("nodes", "0005_remove_seed_nodes"),
    ]

    operations = [
        migrations.CreateModel(
            name="SSHAccount",
            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)),
                ("username", models.CharField(max_length=150)),
                (
                    "password",
                    apps.sigils.fields.SigilShortAutoField(
                        blank=True,
                        help_text="Password for password-based authentication.",
                        max_length=255,
                    ),
                ),
                (
                    "private_key",
                    models.FileField(
                        blank=True,
                        help_text="Optional private key for key-based authentication.",
                        upload_to=apps.nodes.models.ssh_key_upload_path,
                    ),
                ),
                (
                    "public_key",
                    models.FileField(
                        blank=True,
                        help_text="Optional public key for key-based authentication.",
                        upload_to=apps.nodes.models.ssh_key_upload_path,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "node",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ssh_accounts",
                        to="nodes.node",
                    ),
                ),
            ],
            options={
                "verbose_name": "SSH Account",
                "verbose_name_plural": "SSH Accounts",
                "ordering": ("username", "pk"),
                "unique_together": {("node", "username")},
            },
        ),
    ]
