symposion_app/pinaxcon/raffle/migrations/0001_initial.py
2019-01-02 01:44:57 +00:00

93 lines
4 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-01 03:32
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pinaxcon.raffle.mixins
class Migration(migrations.Migration):
initial = True
dependencies = [
('registrasion', '0008_auto_20170930_1843'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Draw',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('drawn_time', models.DateTimeField(auto_now_add=True)),
('drawn_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='DrawnTicket',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ticket', models.CharField(max_length=255)),
('draw', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pinaxcon_raffle.Draw')),
('lineitem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.LineItem')),
],
),
migrations.CreateModel(
name='Prize',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.CharField(max_length=255)),
('order', models.PositiveIntegerField()),
],
bases=(pinaxcon.raffle.mixins.PrizeMixin, models.Model),
),
migrations.CreateModel(
name='PrizeAudit',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reason', models.CharField(max_length=255)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('prize', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='audit_events', to='pinaxcon_raffle.Prize')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('-timestamp',),
},
),
migrations.CreateModel(
name='Raffle',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.CharField(max_length=255)),
('products', models.ManyToManyField(to='registrasion.Product')),
],
bases=(pinaxcon.raffle.mixins.RaffleMixin, models.Model),
),
migrations.AddField(
model_name='prize',
name='raffle',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prizes', to='pinaxcon_raffle.Raffle'),
),
migrations.AddField(
model_name='prize',
name='winning_ticket',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='pinaxcon_raffle.DrawnTicket'),
),
migrations.AddField(
model_name='drawnticket',
name='prize',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pinaxcon_raffle.Prize'),
),
migrations.AddField(
model_name='draw',
name='raffle',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='draws', to='pinaxcon_raffle.Raffle'),
),
migrations.AlterUniqueTogether(
name='prize',
unique_together=set([('raffle', 'order')]),
),
]