# Generated by Django 4.0.2 on 2022-02-22 01:23

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('medialib', '__first__'),
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('oid', models.CharField(blank=True, db_index=True, default='', max_length=250)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('archived', models.BooleanField(blank=True, default=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, default=None, null=True)),
                ('kind', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('is_public', models.BooleanField(blank=True, default=False)),
            ],
            bases=(models.Model, rest.models.RestModel, rest.models.MetaDataModel),
        ),
        migrations.CreateModel(
            name='Release',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('notes', models.TextField(blank=True, default=None, null=True)),
                ('version_num', models.IntegerField(db_index=True, default=1)),
                ('version_str', models.CharField(blank=True, max_length=32, null=True)),
                ('media', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='medialib.mediaitem')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='account.member')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='releases', to='pushit.product')),
            ],
            bases=(models.Model, rest.models.RestModel, rest.models.MetaDataModel),
        ),
        migrations.CreateModel(
            name='ProductMetaData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, db_index=True, default=None, max_length=32, null=True)),
                ('key', models.CharField(db_index=True, max_length=80)),
                ('value_format', models.CharField(max_length=16)),
                ('value', models.TextField()),
                ('int_value', models.IntegerField(blank=True, default=None, null=True)),
                ('float_value', models.IntegerField(blank=True, default=None, null=True)),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='pushit.product')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='product',
            name='beta',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='pushit.release'),
        ),
        migrations.AddField(
            model_name='product',
            name='current',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='pushit.release'),
        ),
        migrations.AddField(
            model_name='product',
            name='group',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='account.group'),
        ),
        migrations.AddField(
            model_name='product',
            name='library',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='medialib.medialibrary'),
        ),
        migrations.AddField(
            model_name='product',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='account.member'),
        ),
    ]
