# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-02 18:40
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Compos',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(blank=True, max_length=512, null=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='composes',
                                             to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ComposBranch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('branch_id', models.IntegerField()),
                ('tag', models.CharField(blank=True, max_length=512)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('compos', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='branches',
                                             to='workspace.Compos')),
            ],
        ),
        migrations.CreateModel(
            name='ComposCommit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('commit_id', models.IntegerField()),
                ('tag', models.CharField(blank=True, max_length=512)),
                ('title', models.CharField(max_length=512)),
                ('branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='commits',
                                             to='workspace.ComposBranch')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='composcommit',
            unique_together=set([('tag', 'branch'), ('commit_id', 'branch')]),
        ),
        migrations.AlterUniqueTogether(
            name='composbranch',
            unique_together=set([('tag', 'compos'), ('branch_id', 'compos')]),
        ),
    ]
