# Generated by Django 4.2.15 on 2025-01-22 18:24

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


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0118_signing_key_assets'),
    ]

    operations = [
        migrations.AlterField(
            model_name='workspace',
            name='default_file_store',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='default_workspaces',
                to='db.filestore',
            ),
        ),
        migrations.CreateModel(
            name='FileStoreInScope',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('upload_priority', models.IntegerField(blank=True, null=True)),
                (
                    'download_priority',
                    models.IntegerField(blank=True, null=True),
                ),
                ('drain', models.BooleanField(default=False)),
                ('drain_to', models.TextField(blank=True, null=True)),
                ('populate', models.BooleanField(default=False)),
                ('read_only', models.BooleanField(default=False)),
                ('soft_max_size', models.IntegerField(blank=True, null=True)),
                ('write_only', models.BooleanField(default=False)),
                (
                    'file_store',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to='db.filestore',
                    ),
                ),
                (
                    'scope',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to='db.scope',
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name='scope',
            name='file_stores',
            field=models.ManyToManyField(
                related_name='scopes',
                through='db.FileStoreInScope',
                to='db.filestore',
            ),
        ),
        migrations.AddConstraint(
            model_name='filestoreinscope',
            constraint=models.UniqueConstraint(
                fields=('scope', 'file_store'),
                name='db_filestoreinscope_unique_scope_file_store',
            ),
        ),
    ]
