-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0001_initial.py
More file actions
122 lines (116 loc) · 4.11 KB
/
0001_initial.py
File metadata and controls
122 lines (116 loc) · 4.11 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Generated by Django 5.2b1 on 2025-03-30 18:24
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name='Company',
fields=[
(
'password',
models.CharField(max_length=128, verbose_name='password'),
),
(
'last_login',
models.DateTimeField(
blank=True, null=True, verbose_name='last login'
),
),
(
'id',
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
verbose_name='UUID',
),
),
('email', models.EmailField(max_length=120, unique=True)),
('name', models.CharField(max_length=50)),
('token_version', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('is_active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Promo',
fields=[
(
'id',
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
verbose_name='UUID',
),
),
('description', models.CharField(max_length=300)),
(
'image_url',
models.URLField(blank=True, max_length=350, null=True),
),
('target', models.JSONField(default=dict)),
('max_count', models.IntegerField()),
('active_from', models.DateField(blank=True, null=True)),
('active_until', models.DateField(blank=True, null=True)),
(
'mode',
models.CharField(
choices=[('COMMON', 'Common'), ('UNIQUE', 'Unique')],
max_length=10,
),
),
(
'promo_common',
models.CharField(blank=True, max_length=30, null=True),
),
('active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
(
'company',
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to='business.company',
),
),
],
),
migrations.CreateModel(
name='PromoCode',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('code', models.CharField(max_length=30)),
('is_used', models.BooleanField(default=False)),
('used_at', models.DateTimeField(blank=True, null=True)),
(
'promo',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='unique_codes',
to='business.promo',
),
),
],
options={
'unique_together': {('promo', 'code')},
},
),
]