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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='MotionEvent',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Short title for the motion', max_length=255)),
                ('slug', models.SlugField(blank=True, max_length=255, unique=True)),
                ('description', models.TextField(blank=True, help_text='Full text of the motion being seconded')),
                ('is_active', models.BooleanField(default=True)),
                ('is_archived', models.BooleanField(default=False)),
                ('archived_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Motion Event',
                'verbose_name_plural': 'Motion Events',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='MotionVote',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('registration_code', models.CharField(max_length=100)),
                ('full_name', models.CharField(blank=True, max_length=255)),
                ('vote', models.CharField(choices=[('YES', 'Yes — I second the motion'), ('NO', 'No — I oppose the motion')], max_length=3)),
                ('voted_at', models.DateTimeField(auto_now_add=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='motion_secondment.motionevent')),
            ],
            options={
                'verbose_name': 'Motion Vote',
                'verbose_name_plural': 'Motion Votes',
                'ordering': ['-voted_at'],
                'unique_together': {('event', 'registration_code')},
            },
        ),
    ]
