a3b7455e5a9fe69e625373fceb12676cad23f08a
[wolnelektury.git] / src / club / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 # Generated by Django 1.11.20 on 2019-03-04 20:50
3 from __future__ import unicode_literals
4
5 from django.conf import settings
6 from django.db import migrations, models
7 import django.db.models.deletion
8
9
10 class Migration(migrations.Migration):
11
12     initial = True
13
14     dependencies = [
15         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16     ]
17
18     operations = [
19         migrations.CreateModel(
20             name='Membership',
21             fields=[
22                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
23                 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
24                 ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user')),
25             ],
26             options={
27                 'verbose_name': 'membership',
28                 'verbose_name_plural': 'memberships',
29             },
30         ),
31         migrations.CreateModel(
32             name='Payment',
33             fields=[
34                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
35                 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
36                 ('payed_at', models.DateTimeField(blank=True, null=True, verbose_name='payed at')),
37             ],
38             options={
39                 'verbose_name': 'payment',
40                 'verbose_name_plural': 'payments',
41             },
42         ),
43         migrations.CreateModel(
44             name='Plan',
45             fields=[
46                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
47                 ('interval', models.SmallIntegerField(choices=[(30, 'a month'), (365, 'a year'), (999, 'in perpetuity')], verbose_name='inteval')),
48                 ('min_amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='min_amount')),
49                 ('allow_recurring', models.BooleanField(verbose_name='allow recurring')),
50                 ('allow_one_time', models.BooleanField(verbose_name='allow one time')),
51             ],
52             options={
53                 'ordering': ('interval',),
54             },
55         ),
56         migrations.CreateModel(
57             name='ReminderEmail',
58             fields=[
59                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
60                 ('days_before', models.SmallIntegerField(verbose_name='days before')),
61                 ('subject', models.CharField(max_length=1024, verbose_name='subject')),
62                 ('subject_de', models.CharField(max_length=1024, null=True, verbose_name='subject')),
63                 ('subject_en', models.CharField(max_length=1024, null=True, verbose_name='subject')),
64                 ('subject_es', models.CharField(max_length=1024, null=True, verbose_name='subject')),
65                 ('subject_fr', models.CharField(max_length=1024, null=True, verbose_name='subject')),
66                 ('subject_it', models.CharField(max_length=1024, null=True, verbose_name='subject')),
67                 ('subject_lt', models.CharField(max_length=1024, null=True, verbose_name='subject')),
68                 ('subject_pl', models.CharField(max_length=1024, null=True, verbose_name='subject')),
69                 ('subject_ru', models.CharField(max_length=1024, null=True, verbose_name='subject')),
70                 ('subject_uk', models.CharField(max_length=1024, null=True, verbose_name='subject')),
71                 ('body', models.TextField(verbose_name='body')),
72                 ('body_de', models.TextField(null=True, verbose_name='body')),
73                 ('body_en', models.TextField(null=True, verbose_name='body')),
74                 ('body_es', models.TextField(null=True, verbose_name='body')),
75                 ('body_fr', models.TextField(null=True, verbose_name='body')),
76                 ('body_it', models.TextField(null=True, verbose_name='body')),
77                 ('body_lt', models.TextField(null=True, verbose_name='body')),
78                 ('body_pl', models.TextField(null=True, verbose_name='body')),
79                 ('body_ru', models.TextField(null=True, verbose_name='body')),
80                 ('body_uk', models.TextField(null=True, verbose_name='body')),
81             ],
82             options={
83                 'ordering': ['days_before'],
84                 'verbose_name': 'reminder email',
85                 'verbose_name_plural': 'reminder emails',
86             },
87         ),
88         migrations.CreateModel(
89             name='Schedule',
90             fields=[
91                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
92                 ('key', models.CharField(max_length=255, unique=True, verbose_name='key')),
93                 ('email', models.EmailField(max_length=254, verbose_name='email')),
94                 ('amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='amount')),
95                 ('method', models.CharField(choices=[(b'payu', b'PayU'), (b'payu-re', b'PayU Recurring'), (b'paypal-re', b'PayPal Recurring')], max_length=255, verbose_name='method')),
96                 ('is_active', models.BooleanField(default=False, verbose_name='active')),
97                 ('is_cancelled', models.BooleanField(default=False, verbose_name='cancelled')),
98                 ('started_at', models.DateTimeField(auto_now_add=True, verbose_name='started at')),
99                 ('expires_at', models.DateTimeField(blank=True, null=True, verbose_name='expires_at')),
100                 ('membership', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='club.Membership', verbose_name='membership')),
101                 ('plan', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='club.Plan', verbose_name='plan')),
102             ],
103             options={
104                 'verbose_name': 'schedule',
105                 'verbose_name_plural': 'schedules',
106             },
107         ),
108         migrations.AddField(
109             model_name='payment',
110             name='schedule',
111             field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='club.Schedule', verbose_name='schedule'),
112         ),
113     ]