# Generated by Django 5.2.7 on 2026-02-12 15:19

import django.db.models.deletion
import mojo.models.rest
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0025_remove_passkeychallenge_user_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='VaultData',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('name', models.CharField(max_length=64)),
                ('description', models.TextField(blank=True, default=None, null=True)),
                ('ekey', models.TextField()),
                ('edata', models.TextField()),
                ('hashed_password', models.TextField(blank=True, default=None, null=True)),
                ('metadata', models.JSONField(blank=True, default=dict)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vault_data', to='account.group')),
                ('user', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vault_data', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'indexes': [models.Index(fields=['group', 'created'], name='filevault_v_group_i_1630ce_idx'), models.Index(fields=['user', 'created'], name='filevault_v_user_id_f8e65e_idx')],
            },
            bases=(models.Model, mojo.models.rest.MojoModel),
        ),
        migrations.CreateModel(
            name='VaultFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True, db_index=True)),
                ('uuid', models.CharField(db_index=True, max_length=64, unique=True)),
                ('name', models.CharField(max_length=200)),
                ('content_type', models.CharField(max_length=128)),
                ('description', models.TextField(blank=True, default=None, null=True)),
                ('size', models.BigIntegerField(default=0)),
                ('chunk_count', models.IntegerField(default=0)),
                ('is_encrypted', models.IntegerField(default=2)),
                ('ekey', models.TextField()),
                ('hashed_password', models.TextField(blank=True, default=None, null=True)),
                ('metadata', models.JSONField(blank=True, default=dict)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vault_files', to='account.group')),
                ('unlocked_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vault_unlocked_files', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vault_files', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'indexes': [models.Index(fields=['group', 'created'], name='filevault_v_group_i_7b3a2d_idx'), models.Index(fields=['user', 'created'], name='filevault_v_user_id_4da13d_idx')],
            },
            bases=(models.Model, mojo.models.rest.MojoModel),
        ),
    ]
