This repository was archived by the owner on Jul 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path0001_initial.py
72 lines (66 loc) · 2.98 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Generated by Django 3.0.1 on 2019-12-20 21:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('balance', models.DecimalField(decimal_places=2, max_digits=10)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Notification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('kind', models.IntegerField()),
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.Profile')),
],
),
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.FileField(unique=True, upload_to='entries/%Y/%m/%d/')),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.Category')),
],
),
migrations.CreateModel(
name='Subscription',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('expires', models.DateTimeField()),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.Category')),
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.Profile')),
],
options={
'unique_together': {('profile', 'category')},
},
),
migrations.CreateModel(
name='Price',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cost', models.DecimalField(decimal_places=2, max_digits=10)),
('period', models.IntegerField()),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bookshelf.Category')),
],
options={
'unique_together': {('category', 'period')},
},
),
]