# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-26 05:39
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Body',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('location', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Honorific',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('neutral', models.CharField(max_length=30)),
                ('masculine', models.CharField(max_length=30)),
                ('feminine', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Legislation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('reference', models.URLField()),
                ('body', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Body')),
                ('netatively_relation_legislation', models.ManyToManyField(related_name='_legislation_netatively_relation_legislation_+', to='legislation.Legislation')),
                ('positively_related_legislation', models.ManyToManyField(related_name='_legislation_positively_related_legislation_+', to='legislation.Legislation')),
            ],
        ),
        migrations.CreateModel(
            name='Legislator',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('family_name', models.CharField(max_length=30)),
                ('given_name', models.CharField(max_length=30)),
                ('gender', models.CharField(choices=[('F', 'Feminine'), ('N', 'Nonbinary'), ('M', 'Masculine')], max_length=1)),
                ('party', models.CharField(max_length=3)),
                ('phone_number', models.CharField(blank=True, max_length=16, validators=[django.core.validators.RegexValidator(message='Phone number must be in the format +999999999. Up to 15 digits allowed.', regex='^\\+?1?\\d{9,15}$')])),
                ('body', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Body')),
            ],
        ),
        migrations.CreateModel(
            name='Party',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('abbreviation', models.CharField(max_length=3)),
            ],
        ),
        migrations.CreateModel(
            name='Pronouns',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sub', models.CharField(max_length=30)),
                ('obj', models.CharField(max_length=30)),
                ('own', models.CharField(max_length=30)),
                ('ref', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vote', models.CharField(choices=[('Y', 'Yea'), ('N', 'Nay'), ('A', 'Abstain')], max_length=1)),
                ('legislator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Legislator')),
            ],
        ),
        migrations.AddField(
            model_name='legislator',
            name='pronouns',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Pronouns'),
        ),
        migrations.AddField(
            model_name='legislation',
            name='sponsors',
            field=models.ManyToManyField(to='legislation.Legislator'),
        ),
        migrations.AddField(
            model_name='legislation',
            name='votes',
            field=models.ManyToManyField(to='legislation.Vote'),
        ),
        migrations.AddField(
            model_name='body',
            name='controlling_party',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Party'),
        ),
        migrations.AddField(
            model_name='body',
            name='honorific',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='legislation.Honorific'),
        ),
    ]
