-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy path0001_initial.py
More file actions
116 lines (110 loc) · 6.24 KB
/
0001_initial.py
File metadata and controls
116 lines (110 loc) · 6.24 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
# Generated by Django 4.2.6 on 2023-10-25 06:08
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='BusinessAccount',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('business_name', models.CharField(max_length=100)),
('street_name', models.CharField(max_length=100)),
('locality', models.CharField(max_length=100)),
('latitude', models.DecimalField(decimal_places=6, max_digits=9)),
('longitude', models.DecimalField(decimal_places=6, max_digits=9)),
],
),
migrations.CreateModel(
name='Cuisine',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
],
),
migrations.CreateModel(
name='Image',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('image', models.ImageField(upload_to='images/')),
],
),
migrations.CreateModel(
name='User',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=100, unique=True)),
('phone_number', models.CharField(max_length=15)),
('image', models.ImageField(upload_to='user_images/')),
('is_vegetarian', models.BooleanField()),
],
),
migrations.CreateModel(
name='Account',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('email', models.EmailField(max_length=254, unique=True)),
('username', models.CharField(max_length=150)),
('is_user', models.BooleanField(default=False)),
('is_business', models.BooleanField(default=False)),
('business_profile', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='account_business_profile', to='Account_App.businessaccount')),
('groups', models.ManyToManyField(blank=True, related_name='account_groups', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, related_name='account_user_permissions', to='auth.permission', verbose_name='user permissions')),
('user_profile', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='account_user_profile', to='Account_App.user')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Review',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rating', models.IntegerField(choices=[(0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5')], validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(5)])),
('comment', models.TextField()),
('business_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account_reviews', to='Account_App.businessaccount')),
('images', models.ManyToManyField(to='Account_App.image')),
('user_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account_reviews', to='Account_App.user')),
],
),
migrations.AddField(
model_name='businessaccount',
name='cuisines',
field=models.ManyToManyField(to='Account_App.cuisine'),
),
migrations.AddField(
model_name='businessaccount',
name='images',
field=models.ManyToManyField(related_name='business_account_images', to='Account_App.image'),
),
migrations.AddField(
model_name='businessaccount',
name='menu',
field=models.ManyToManyField(related_name='business_account_menu', to='Account_App.image'),
),
migrations.AddField(
model_name='businessaccount',
name='reviews',
field=models.ManyToManyField(related_name='business_accounts', to='Account_App.review'),
),
]