# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-08-16 12:05
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='Column',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('table_name', models.CharField(max_length=256)),
                ('column_name', models.CharField(max_length=256)),
                ('datatype', models.CharField(max_length=256)),
                ('arraysize', models.IntegerField(blank=True, null=True)),
                ('size', models.IntegerField(blank=True, null=True)),
                ('description', models.CharField(blank=True, max_length=256, null=True)),
                ('utype', models.CharField(blank=True, max_length=256, null=True)),
                ('unit', models.CharField(blank=True, max_length=256, null=True)),
                ('ucd', models.CharField(blank=True, max_length=256, null=True)),
                ('principal', models.BooleanField(default=False)),
                ('indexed', models.BooleanField(default=False)),
                ('std', models.BooleanField(default=False)),
                ('column_index', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'columns',
            },
        ),
        migrations.CreateModel(
            name='Schema',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schema_name', models.CharField(max_length=256)),
                ('utype', models.CharField(blank=True, max_length=256, null=True)),
                ('description', models.CharField(blank=True, max_length=256, null=True)),
            ],
            options={
                'db_table': 'schemas',
            },
        ),
        migrations.CreateModel(
            name='Table',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schema_name', models.CharField(max_length=256)),
                ('table_name', models.CharField(max_length=256)),
                ('table_type', models.CharField(max_length=256)),
                ('utype', models.CharField(blank=True, max_length=256, null=True)),
                ('description', models.CharField(blank=True, max_length=256, null=True)),
                ('table_index', models.IntegerField(blank=True, null=True)),
                ('schema', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tables', to='daiquiri_tap.Schema')),
            ],
            options={
                'db_table': 'tables',
            },
        ),
        migrations.AddField(
            model_name='column',
            name='table',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', to='daiquiri_tap.Table'),
        ),
    ]
