# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-27 09:32
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='create date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='modified date')),
                ('comment_id', models.IntegerField(unique=True, verbose_name='comment id')),
                ('comment_type', models.PositiveSmallIntegerField(choices=[(0, 'COMMENTS'), (1, 'REVIEW COMMENTS')], default=1, verbose_name='comment type')),
                ('author', models.CharField(max_length=32, verbose_name='comment author')),
                ('body', models.TextField(verbose_name='comment body')),
                ('created_at', models.DateTimeField(verbose_name='comment created date')),
                ('updated_at', models.DateTimeField(verbose_name='comment uodated date')),
            ],
            options={
                'verbose_name': 'comment',
                'verbose_name_plural': 'comments',
            },
        ),
        migrations.CreateModel(
            name='Commit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='create date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='modified date')),
                ('sha', models.CharField(db_index=True, max_length=64, unique=True, verbose_name='git commit sha')),
                ('author', models.CharField(max_length=32, verbose_name='commit author')),
                ('email', models.EmailField(max_length=254, verbose_name='commit email')),
                ('date', models.DateTimeField(verbose_name='commit date')),
                ('message', models.TextField(verbose_name='commit message')),
            ],
            options={
                'verbose_name': 'commit',
                'verbose_name_plural': 'commits',
            },
        ),
        migrations.CreateModel(
            name='Pull',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='create date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='modified date')),
                ('pull_number', models.IntegerField(unique=True, verbose_name='pull request number')),
                ('title', models.CharField(max_length=256, verbose_name='pull request title')),
                ('author', models.CharField(max_length=32, verbose_name='pull request by')),
                ('body', models.TextField(verbose_name='pull request body')),
                ('bug_id', models.CharField(max_length=32, null=True, verbose_name='bug id')),
                ('pull_state', models.PositiveSmallIntegerField(choices=[(0, 'CLOSED'), (1, 'OPEN')], default=1, verbose_name='pull state')),
                ('pull_merged', models.BooleanField(default=False, verbose_name='is pull merged')),
                ('comments', models.IntegerField(default=0, verbose_name='comments')),
                ('review_comments', models.IntegerField(default=0, verbose_name='review_comments')),
                ('commits', models.IntegerField(default=0, verbose_name='commits')),
                ('additions', models.IntegerField(default=0, verbose_name='commits additions')),
                ('deletions', models.IntegerField(default=0, verbose_name='commits deletions')),
                ('changed_files', models.IntegerField(default=0, verbose_name='changed files ')),
                ('created_at', models.DateTimeField(verbose_name='pull request created date')),
                ('updated_at', models.DateTimeField(verbose_name='pull request uodated date')),
                ('closed_at', models.DateTimeField(null=True, verbose_name='pull request closed date')),
            ],
            options={
                'verbose_name': 'pull_request',
                'verbose_name_plural': 'pull_requests',
            },
        ),
        migrations.CreateModel(
            name='Repository',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='create date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='modified date')),
                ('owner', models.CharField(max_length=32, verbose_name='repository owner')),
                ('repo', models.CharField(max_length=32, verbose_name='repository name')),
            ],
            options={
                'verbose_name': 'repository',
                'verbose_name_plural': 'repositories',
            },
        ),
        migrations.AlterUniqueTogether(
            name='repository',
            unique_together=set([('owner', 'repo')]),
        ),
        migrations.AddField(
            model_name='pull',
            name='repository',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='statistics.Repository', verbose_name='repository'),
        ),
        migrations.AddField(
            model_name='commit',
            name='pull',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='statistics.Pull', verbose_name='pull request'),
        ),
        migrations.AddField(
            model_name='commit',
            name='repository',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='statistics.Repository', verbose_name='repository'),
        ),
        migrations.AddField(
            model_name='comment',
            name='pull',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='statistics.Pull', verbose_name='pull request'),
        ),
    ]
