mirror of
https://github.com/andwati/store-api.git
synced 2026-10-18 09:22:53 +00:00
49 lines
1.9 KiB
Python
49 lines
1.9 KiB
Python
# Generated by Django 5.0.2 on 2024-03-03 01:24
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Brand",
|
|
fields=[
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
("name", models.CharField(max_length=100)),
|
|
("description", models.TextField(blank=True)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="Supplier",
|
|
fields=[
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
("name", models.CharField(max_length=100)),
|
|
("email", models.EmailField(max_length=254)),
|
|
("phone", models.CharField(max_length=20)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="Product",
|
|
fields=[
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
("name", models.CharField(max_length=100)),
|
|
("description", models.TextField()),
|
|
("sku", models.CharField(max_length=50)),
|
|
("price", models.DecimalField(decimal_places=2, max_digits=10)),
|
|
("quantity", models.IntegerField(default=0)),
|
|
("barcode", models.CharField(blank=True, max_length=100, null=True)),
|
|
("brand", models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to="products.brand")),
|
|
(
|
|
"supplier",
|
|
models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to="products.supplier"),
|
|
),
|
|
],
|
|
),
|
|
]
|