# Generated by Django 5.2.4 on 2025-07-30 19:26

import django.db.models.deletion
import taggit.managers
import utilities.json
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('extras', '0123_journalentry_kind_default'),
        ('proxmox2netbox', '0008_alter_proxmoxendpoint_unique_together_and_more'),
        ('virtualization', '0048_populate_mac_addresses'),
    ]

    operations = [
        migrations.CreateModel(
            name='VMBackup',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('last_updated', models.DateTimeField(auto_now=True, null=True)),
                ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
                ('storage', models.CharField(max_length=255, null=True)),
                ('subtype', models.CharField(default='undefined', max_length=255)),
                ('format', models.CharField(default='undefined', max_length=255)),
                ('creation_time', models.DateTimeField(blank=True, null=True)),
                ('size', models.BigIntegerField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, null=True)),
                ('volume_id', models.CharField(blank=True, max_length=255, null=True)),
                ('vmid', models.IntegerField(blank=True, null=True)),
                ('used', models.BigIntegerField(blank=True, null=True)),
                ('encrypted', models.BooleanField(default=False)),
                ('verification_state', models.CharField(blank=True, max_length=255, null=True)),
                ('verification_upid', models.CharField(blank=True, max_length=255, null=True)),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
                ('virtual_machine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='backups', to='virtualization.virtualmachine')),
            ],
            options={
                'verbose_name': 'VM Backup',
                'verbose_name_plural': 'VM Backups',
                'ordering': ('storage', 'virtual_machine', 'creation_time'),
                'unique_together': {('storage', 'virtual_machine', 'subtype', 'format', 'creation_time', 'volume_id', 'vmid')},
            },
        ),
    ]
