# Generated by Django 3.2.12 on 2022-09-05 15:00

from django.db import migrations
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps

from debusine.db.models.files import (
    DEFAULT_FILE_STORE_NAME,
    _FileStoreBackendChoices,
)


def create_default_store(
    apps: StateApps, schema_editor: BaseDatabaseSchemaEditor
) -> None:
    FileStore = apps.get_model("db", "FileStore")

    FileStore.objects.create(
        name=DEFAULT_FILE_STORE_NAME,
        backend=_FileStoreBackendChoices.LOCAL,
        configuration={},
    )


class Migration(migrations.Migration):
    dependencies = [
        ('db', '0001_initial'),
    ]

    operations = [migrations.RunPython(create_default_store)]
