ammar101's picture
Deploy application code and models
0bb49b0
# Generated by Django 5.2.5 on 2026-01-07 12:09
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BodyScan',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('session_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
('height', models.DecimalField(decimal_places=2, max_digits=5)),
('shoulder_width', models.DecimalField(decimal_places=2, max_digits=5)),
('chest', models.DecimalField(decimal_places=2, max_digits=5)),
('waist', models.DecimalField(decimal_places=2, max_digits=5)),
('skin_tone', models.CharField(choices=[('light', 'Light'), ('medium', 'Medium'), ('dark', 'Dark')], max_length=10)),
('scanned_at', models.DateTimeField(auto_now_add=True)),
],
options={
'ordering': ['-scanned_at'],
},
),
migrations.CreateModel(
name='Color',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('hex_code', models.CharField(max_length=7)),
('category', models.CharField(choices=[('light', 'Light Colors'), ('medium', 'Medium Colors'), ('dark', 'Dark Colors'), ('neutral', 'Neutral Colors'), ('vibrant', 'Vibrant Colors')], max_length=20)),
],
options={
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('category', models.CharField(choices=[('shirt', 'Shirt'), ('pants', 'Pants'), ('jacket', 'Jacket'), ('dress', 'Dress'), ('skirt', 'Skirt')], max_length=20)),
('fit_type', models.CharField(choices=[('slim', 'Slim Fit'), ('regular', 'Regular Fit'), ('oversize', 'Oversize Fit')], max_length=20)),
('gender', models.CharField(choices=[('men', 'Men'), ('women', 'Women'), ('unisex', 'Unisex')], max_length=10)),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('description', models.TextField()),
('image_url', models.URLField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
options={
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Size',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=10, unique=True)),
('chest_min', models.DecimalField(decimal_places=2, max_digits=5)),
('chest_max', models.DecimalField(decimal_places=2, max_digits=5)),
('waist_min', models.DecimalField(decimal_places=2, max_digits=5)),
('waist_max', models.DecimalField(decimal_places=2, max_digits=5)),
('shoulder_min', models.DecimalField(decimal_places=2, max_digits=5)),
('shoulder_max', models.DecimalField(decimal_places=2, max_digits=5)),
('height_min', models.DecimalField(decimal_places=2, max_digits=5)),
('height_max', models.DecimalField(decimal_places=2, max_digits=5)),
],
options={
'ordering': ['id'],
},
),
migrations.CreateModel(
name='ProductVariant',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sku', models.CharField(max_length=50, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('color', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fitting_system.color')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='variants', to='fitting_system.product')),
('size', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fitting_system.size')),
],
options={
'ordering': ['product', 'size', 'color'],
'unique_together': {('product', 'size', 'color')},
},
),
migrations.CreateModel(
name='Inventory',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.IntegerField(default=0)),
('low_stock_threshold', models.IntegerField(default=5)),
('last_updated', models.DateTimeField(auto_now=True)),
('product_variant', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='inventory', to='fitting_system.productvariant')),
],
options={
'verbose_name_plural': 'Inventories',
},
),
migrations.CreateModel(
name='Recommendation',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('recommended_size', models.CharField(max_length=10)),
('recommended_fit', models.CharField(max_length=20)),
('recommended_colors', models.TextField()),
('priority', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('body_scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recommendations', to='fitting_system.bodyscan')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fitting_system.product')),
],
options={
'ordering': ['-priority', 'product'],
},
),
]