# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-09 05:04
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 = [
        ('auth', '0008_alter_user_username_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('ntwf', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Directory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created On')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified On')),
                ('name', models.CharField(max_length=128, verbose_name='Directory Name')),
                ('created_by_id', models.ForeignKey(db_column='created_by_id', default=1, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='createdfile_manager_directory_related', to=settings.AUTH_USER_MODEL)),
                ('modified_by_id', models.ForeignKey(db_column='modified_by_id', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='modifiedfile_manager_directory_related', to=settings.AUTH_USER_MODEL)),
                ('owner_id', models.ForeignKey(db_column='owner_id', on_delete=django.db.models.deletion.CASCADE, related_name='directory_owner', to=settings.AUTH_USER_MODEL)),
                ('parent_id', models.ForeignKey(blank=True, db_column='parent_id', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sub_directories', to='file_manager.Directory')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created On')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified On')),
                ('name', models.CharField(max_length=256, verbose_name='File Name')),
                ('modified_file_name', models.CharField(max_length=256, null=True, verbose_name='Modified_file_name')),
                ('file_type', models.CharField(max_length=128, verbose_name='Type')),
                ('file_content_type', models.CharField(max_length=256, null=True, verbose_name='Content Type')),
                ('size', models.FloatField(verbose_name='Size')),
                ('created_by_id', models.ForeignKey(db_column='created_by_id', default=1, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='createdfile_manager_file_related', to=settings.AUTH_USER_MODEL)),
                ('directory_id', models.ForeignKey(db_column='directory_id', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='file_ids', to='file_manager.Directory')),
                ('modified_by_id', models.ForeignKey(db_column='modified_by_id', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='modifiedfile_manager_file_related', to=settings.AUTH_USER_MODEL)),
                ('owner_id', models.ForeignKey(db_column='owner_id', on_delete=django.db.models.deletion.CASCADE, related_name='file_owner', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Share',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created On')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified On')),
                ('can_read', models.NullBooleanField(verbose_name='Can Read')),
                ('can_write', models.NullBooleanField(verbose_name='Can Write')),
                ('can_delete', models.NullBooleanField(verbose_name='Can Delete')),
                ('created_by_id', models.ForeignKey(db_column='created_by_id', default=1, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='createdfile_manager_share_related', to=settings.AUTH_USER_MODEL)),
                ('directory_id', models.ForeignKey(db_column='directory_id', db_constraint=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shared_dirs', to='file_manager.Directory')),
                ('file_id', models.ForeignKey(db_column='file_id', db_constraint=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shared_files', to='file_manager.File')),
                ('group_ids', models.ManyToManyField(blank=True, to='auth.Group')),
                ('modified_by_id', models.ForeignKey(db_column='modified_by_id', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='modifiedfile_manager_share_related', to=settings.AUTH_USER_MODEL)),
                ('user_ids', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created On')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified On')),
                ('name', models.CharField(max_length=128, verbose_name='Tag Name')),
                ('created_by_id', models.ForeignKey(db_column='created_by_id', default=1, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='createdfile_manager_tag_related', to=settings.AUTH_USER_MODEL)),
                ('modified_by_id', models.ForeignKey(db_column='modified_by_id', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='modifiedfile_manager_tag_related', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='file',
            name='tags',
            field=models.ManyToManyField(blank=True, db_constraint=False, null=True, to='file_manager.Tag'),
        ),
        migrations.AddField(
            model_name='file',
            name='workflow_id',
            field=models.OneToOneField(db_column='workflow_id', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='workflow_ids', to='ntwf.WorkFlow'),
        ),
        migrations.AddField(
            model_name='directory',
            name='tags',
            field=models.ManyToManyField(blank=True, null=True, to='file_manager.Tag'),
        ),
        migrations.AddField(
            model_name='directory',
            name='workflow_id',
            field=models.OneToOneField(db_column='workflow_id', null=True, on_delete=django.db.models.deletion.PROTECT, to='ntwf.WorkFlow'),
        ),
    ]
