# Generated by Django 4.2.14 on 2024-07-16 09:26

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    replaces = [
        ('filesfolders', '0001_initial'),
        ('filesfolders', '0002_auto_20180411_1758'),
        ('filesfolders', '0003_rename_uuid'),
        ('filesfolders', '0004_update_uuid'),
        ('filesfolders', '0005_alter_foreignkey_fields'),
    ]

    initial = True

    dependencies = [
        ('projectroles', '0028_populate_finder_role'),
        ('projectroles', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='FileData',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('bytes', models.TextField()),
                ('file_name', models.CharField(max_length=255)),
                ('content_type', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Folder',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'name',
                    models.CharField(
                        help_text='Name for the object', max_length=255
                    ),
                ),
                (
                    'date_modified',
                    models.DateTimeField(
                        auto_now=True, help_text='DateTime of last modification'
                    ),
                ),
                (
                    'flag',
                    models.CharField(
                        blank=True,
                        choices=[
                            ('FLAG', 'Flagged'),
                            ('FLAG_HEART', 'Flagged (Heart)'),
                            ('IMPORTANT', 'Important'),
                            ('REVOKED', 'Revoked'),
                            ('SUPERSEDED', 'Superseded'),
                        ],
                        help_text='Flag for highlighting the item (optional)',
                        max_length=64,
                        null=True,
                    ),
                ),
                (
                    'description',
                    models.CharField(
                        blank=True,
                        help_text='Description (optional)',
                        max_length=255,
                    ),
                ),
                (
                    'sodar_uuid',
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text='Filesfolders SODAR UUID',
                        unique=True,
                    ),
                ),
                (
                    'folder',
                    models.ForeignKey(
                        blank=True,
                        help_text='Folder under which object exists (null if '
                        'root folder)',
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_children',
                        to='filesfolders.folder',
                    ),
                ),
                (
                    'owner',
                    models.ForeignKey(
                        help_text='User who owns the object',
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    'project',
                    models.ForeignKey(
                        help_text='Project in which the object belongs',
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_objects',
                        to='projectroles.project',
                    ),
                ),
            ],
            options={
                'ordering': ['project', 'name'],
                'unique_together': {('project', 'folder', 'name')},
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'name',
                    models.CharField(
                        help_text='Name for the object', max_length=255
                    ),
                ),
                (
                    'date_modified',
                    models.DateTimeField(
                        auto_now=True, help_text='DateTime of last modification'
                    ),
                ),
                (
                    'flag',
                    models.CharField(
                        blank=True,
                        choices=[
                            ('FLAG', 'Flagged'),
                            ('FLAG_HEART', 'Flagged (Heart)'),
                            ('IMPORTANT', 'Important'),
                            ('REVOKED', 'Revoked'),
                            ('SUPERSEDED', 'Superseded'),
                        ],
                        help_text='Flag for highlighting the item (optional)',
                        max_length=64,
                        null=True,
                    ),
                ),
                (
                    'description',
                    models.CharField(
                        blank=True,
                        help_text='Description (optional)',
                        max_length=255,
                    ),
                ),
                (
                    'sodar_uuid',
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text='Filesfolders SODAR UUID',
                        unique=True,
                    ),
                ),
                (
                    'file',
                    models.FileField(
                        blank=True,
                        help_text='Uploaded file',
                        null=True,
                        upload_to='filesfolders.FileData/bytes/file_name/'
                        'content_type',
                    ),
                ),
                (
                    'public_url',
                    models.BooleanField(
                        default=False,
                        help_text='Allow providing a public URL for the file',
                    ),
                ),
                (
                    'secret',
                    models.CharField(
                        help_text='Secret string for creating public URL',
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    'folder',
                    models.ForeignKey(
                        blank=True,
                        help_text='Folder under which object exists (null if '
                        'root folder)',
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_children',
                        to='filesfolders.folder',
                    ),
                ),
                (
                    'owner',
                    models.ForeignKey(
                        help_text='User who owns the object',
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    'project',
                    models.ForeignKey(
                        help_text='Project in which the object belongs',
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_objects',
                        to='projectroles.project',
                    ),
                ),
            ],
            options={
                'ordering': ['folder', 'name'],
                'unique_together': {('project', 'folder', 'name')},
            },
        ),
        migrations.CreateModel(
            name='HyperLink',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'name',
                    models.CharField(
                        help_text='Name for the object', max_length=255
                    ),
                ),
                (
                    'date_modified',
                    models.DateTimeField(
                        auto_now=True, help_text='DateTime of last modification'
                    ),
                ),
                (
                    'flag',
                    models.CharField(
                        blank=True,
                        choices=[
                            ('FLAG', 'Flagged'),
                            ('FLAG_HEART', 'Flagged (Heart)'),
                            ('IMPORTANT', 'Important'),
                            ('REVOKED', 'Revoked'),
                            ('SUPERSEDED', 'Superseded'),
                        ],
                        help_text='Flag for highlighting the item (optional)',
                        max_length=64,
                        null=True,
                    ),
                ),
                (
                    'description',
                    models.CharField(
                        blank=True,
                        help_text='Description (optional)',
                        max_length=255,
                    ),
                ),
                (
                    'sodar_uuid',
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text='Filesfolders SODAR UUID',
                        unique=True,
                    ),
                ),
                (
                    'url',
                    models.URLField(
                        help_text='URL for the link', max_length=2000
                    ),
                ),
                (
                    'folder',
                    models.ForeignKey(
                        blank=True,
                        help_text='Folder under which object exists (null if '
                        'root folder)',
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_children',
                        to='filesfolders.folder',
                    ),
                ),
                (
                    'owner',
                    models.ForeignKey(
                        help_text='User who owns the object',
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    'project',
                    models.ForeignKey(
                        help_text='Project in which the object belongs',
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='%(app_label)s_%(class)s_objects',
                        to='projectroles.project',
                    ),
                ),
            ],
            options={
                'ordering': ['folder', 'name'],
                'unique_together': {('project', 'folder', 'name')},
            },
        ),
    ]
