# Generated by Django 4.2.11 on 2024-07-10 13:59

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


class Migration(migrations.Migration):

    dependencies = [
        ('db', '0069_alter_account_provider_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='apitoken',
            name='is_service',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='exporterhistory',
            name='filters',
            field=models.JSONField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='exporterhistory',
            name='name',
            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Exporter Name'),
        ),
        migrations.AddField(
            model_name='exporterhistory',
            name='type',
            field=models.CharField(choices=[('issue_exports', 'Issue Exports'), ('issue_worklogs', 'Issue Worklogs')], default='issue_exports', max_length=50),
        ),
        migrations.AddField(
            model_name='project',
            name='is_time_tracking_enabled',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='project',
            name='start_date',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='project',
            name='target_date',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.CreateModel(
            name='PageVersion',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Modified At')),
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('last_saved_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('description_binary', models.BinaryField(null=True)),
                ('description_html', models.TextField(blank=True, default='<p></p>')),
                ('description_stripped', models.TextField(blank=True, null=True)),
                ('description_json', models.JSONField(blank=True, default=dict)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
                ('owned_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='page_versions', to=settings.AUTH_USER_MODEL)),
                ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='page_versions', to='db.page')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')),
                ('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='page_versions', to='db.workspace')),
            ],
            options={
                'verbose_name': 'Page Version',
                'verbose_name_plural': 'Page Versions',
                'db_table': 'page_versions',
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='IssueType',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Modified At')),
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('logo_props', models.JSONField(default=dict)),
                ('sort_order', models.FloatField(default=65535)),
                ('is_default', models.BooleanField(default=True)),
                ('weight', models.PositiveIntegerField(default=0)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created_by', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
                ('project', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='project_%(class)s', to='db.project')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated_by', to=settings.AUTH_USER_MODEL, verbose_name='Last Modified By')),
                ('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='workspace_%(class)s', to='db.workspace')),
            ],
            options={
                'verbose_name': 'Issue Type',
                'verbose_name_plural': 'Issue Types',
                'db_table': 'issue_types',
                'ordering': ('sort_order',),
                'unique_together': {('project', 'name')},
            },
        ),
        migrations.AddField(
            model_name='issue',
            name='type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='issue_type', to='db.issuetype'),
        ),
    ]
