Skip to content

Commit 61d057f

Browse files
committed
project: Include initial migrations.
1 parent 2dea889 commit 61d057f

File tree

6 files changed

+256
-0
lines changed

6 files changed

+256
-0
lines changed

accounts/migrations/0001_initial.py

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Generated by Django 3.1.5 on 2021-05-06 16:01
2+
3+
import accounts.models
4+
from decimal import Decimal
5+
from django.conf import settings
6+
from django.db import migrations, models
7+
import django.db.models.deletion
8+
import uuid
9+
10+
11+
class Migration(migrations.Migration):
12+
13+
initial = True
14+
15+
dependencies = [
16+
('auth', '0012_alter_user_first_name_max_length'),
17+
]
18+
19+
operations = [
20+
migrations.CreateModel(
21+
name='User',
22+
fields=[
23+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
24+
('password', models.CharField(max_length=128, verbose_name='password')),
25+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
26+
('email', models.EmailField(max_length=255, unique=True)),
27+
('full_name', models.TextField()),
28+
('phone_number', models.CharField(max_length=50, unique=True)),
29+
('is_active', models.BooleanField(default=True)),
30+
('is_first_login', models.BooleanField(default=True)),
31+
('is_customer', models.BooleanField(default=False)),
32+
('is_artist', models.BooleanField(default=False)),
33+
('is_kalafex_admin', models.BooleanField(default=False)),
34+
('is_staff', models.BooleanField(default=False)),
35+
('is_superuser', models.BooleanField(default=False)),
36+
('date_of_birth', models.DateField()),
37+
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
38+
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
39+
],
40+
options={
41+
'abstract': False,
42+
},
43+
),
44+
migrations.CreateModel(
45+
name='Artist',
46+
fields=[
47+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='accounts.user')),
48+
('bio', models.TextField(blank=True, null=True)),
49+
('custom_url', models.CharField(max_length=255, unique=True)),
50+
('aadhar_card_no', models.TextField(blank=True, null=True)),
51+
('pan_card_no', models.TextField(blank=True, null=True)),
52+
('gst_no', models.TextField(blank=True, null=True)),
53+
('profile_picture', models.ImageField(default='uploads/profile_pictures/default.png', null=True, upload_to=accounts.models.image_directory_path, verbose_name='profile picture')),
54+
('cashout_requested', models.BooleanField(default=False)),
55+
('balance', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
56+
('ifsc_code', models.TextField(blank=True, null=True)),
57+
('account_number', models.TextField(blank=True, null=True)),
58+
('bank_branch', models.TextField(blank=True, null=True)),
59+
('beneficiary_name', models.TextField(blank=True, null=True)),
60+
('upi_id', models.TextField(blank=True, null=True)),
61+
],
62+
options={
63+
'ordering': ['user__full_name'],
64+
},
65+
),
66+
migrations.CreateModel(
67+
name='Customer',
68+
fields=[
69+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='accounts.user')),
70+
('profile_picture', models.ImageField(default='uploads/profile_pictures/default.png', null=True, upload_to=accounts.models.image_directory_path, verbose_name='profile picture')),
71+
],
72+
),
73+
migrations.CreateModel(
74+
name='KalafexAdmin',
75+
fields=[
76+
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='accounts.user')),
77+
],
78+
),
79+
migrations.CreateModel(
80+
name='Address',
81+
fields=[
82+
('a_id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
83+
('street', models.TextField()),
84+
('city', models.CharField(max_length=255)),
85+
('state', models.CharField(max_length=255)),
86+
('pin_code', models.CharField(max_length=100)),
87+
('address_type', models.CharField(choices=[('Billing', 'Billing'), ('Shipping', 'Shipping'), ('Pickup', 'Pickup')], max_length=8)),
88+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
89+
],
90+
options={
91+
'verbose_name_plural': 'addresses',
92+
},
93+
),
94+
]

accounts/migrations/__init__.py

Whitespace-only changes.

orders/migrations/0001_initial.py

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Generated by Django 3.1.5 on 2021-05-06 16:01
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import uuid
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
('accounts', '0001_initial'),
16+
('products', '0001_initial'),
17+
]
18+
19+
operations = [
20+
migrations.CreateModel(
21+
name='Coupon',
22+
fields=[
23+
('code', models.CharField(max_length=15, primary_key=True, serialize=False)),
24+
('price', models.DecimalField(decimal_places=2, max_digits=11)),
25+
],
26+
),
27+
migrations.CreateModel(
28+
name='Order',
29+
fields=[
30+
('o_id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
31+
('start_date', models.DateTimeField(auto_now_add=True)),
32+
('ordered_date', models.DateTimeField(blank=True, null=True)),
33+
('being_delivered', models.BooleanField(default=False)),
34+
('received', models.BooleanField(default=False)),
35+
('refund_requested', models.BooleanField(default=False)),
36+
('refund_granted', models.BooleanField(default=False)),
37+
('refund_rejected', models.BooleanField(default=False)),
38+
('billing_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='billing_address', to='accounts.address')),
39+
('coupon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='orders.coupon')),
40+
('shipping_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='shipping_address', to='accounts.address')),
41+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
42+
],
43+
options={
44+
'ordering': ['-start_date'],
45+
},
46+
),
47+
migrations.CreateModel(
48+
name='Refund',
49+
fields=[
50+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
51+
('reasons', models.TextField()),
52+
('accepted', models.BooleanField(default=False)),
53+
('reject_reasons', models.TextField(blank=True, null=True)),
54+
('order', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='orders.order')),
55+
],
56+
),
57+
migrations.CreateModel(
58+
name='Payment',
59+
fields=[
60+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
61+
('razorpay_order_id', models.TextField()),
62+
('razorpay_payment_id', models.TextField(blank=True, null=True)),
63+
('amount', models.DecimalField(decimal_places=2, max_digits=15)),
64+
('timestamp', models.DateTimeField(auto_now_add=True)),
65+
('paid_successfully', models.BooleanField(default=False)),
66+
('order', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='orders.order')),
67+
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
68+
],
69+
),
70+
migrations.CreateModel(
71+
name='OrderProduct',
72+
fields=[
73+
('op_id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
74+
('quantity', models.IntegerField(default=1)),
75+
('ordered', models.BooleanField(default=False)),
76+
('date_created', models.DateTimeField(auto_now_add=True)),
77+
('handed_over', models.BooleanField(default=False)),
78+
('order', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_products', to='orders.order')),
79+
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
80+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
81+
],
82+
options={
83+
'ordering': ['-date_created'],
84+
},
85+
),
86+
]

orders/migrations/__init__.py

Whitespace-only changes.

products/migrations/0001_initial.py

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Generated by Django 3.1.5 on 2021-05-06 16:01
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import products.models
7+
import uuid
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='Category',
21+
fields=[
22+
('name', models.CharField(max_length=255, primary_key=True, serialize=False)),
23+
('description', models.TextField(null=True)),
24+
('commission', models.DecimalField(decimal_places=2, max_digits=5)),
25+
],
26+
options={
27+
'verbose_name_plural': 'categories',
28+
},
29+
),
30+
migrations.CreateModel(
31+
name='Product',
32+
fields=[
33+
('pid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
34+
('name', models.TextField()),
35+
('description', models.TextField()),
36+
('display_image', models.ImageField(default='products/image_unavailable.png', upload_to=products.models.product_display_image_path)),
37+
('stock_left', models.IntegerField(default=0)),
38+
('original_price', models.DecimalField(decimal_places=2, max_digits=11)),
39+
('kalafex_price', models.DecimalField(decimal_places=2, max_digits=12)),
40+
('discount_price', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
41+
('click_count', models.BigIntegerField(default=0)),
42+
('purchase_count', models.BigIntegerField(default=0)),
43+
('is_approved', models.BooleanField(default=False)),
44+
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
45+
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='products.category')),
46+
],
47+
options={
48+
'ordering': ['-click_count'],
49+
},
50+
),
51+
migrations.CreateModel(
52+
name='SubCategory',
53+
fields=[
54+
('name', models.CharField(max_length=255, primary_key=True, serialize=False)),
55+
('description', models.TextField(null=True)),
56+
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.category')),
57+
],
58+
options={
59+
'verbose_name_plural': 'subcategories',
60+
},
61+
),
62+
migrations.CreateModel(
63+
name='ProductImage',
64+
fields=[
65+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
66+
('image', models.ImageField(upload_to=products.models.product_image_path)),
67+
('mini_description', models.CharField(max_length=255, null=True)),
68+
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
69+
],
70+
),
71+
migrations.AddField(
72+
model_name='product',
73+
name='subcategory',
74+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='products.subcategory'),
75+
),
76+
]

products/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)