backend/marking_hack/market/migrations/0001_initial.py

164 lines
5.3 KiB
Python

# Generated by Django 4.1.7 on 2023-03-25 23:19
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="City",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("fias", models.UUIDField(default=uuid.uuid4, editable=False)),
("name", models.CharField(max_length=250)),
],
),
migrations.CreateModel(
name="Member",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("inn", models.CharField(db_index=True, max_length=32, unique=True)),
],
),
migrations.CreateModel(
name="Region",
fields=[
(
"code",
models.IntegerField(
db_index=True, primary_key=True, serialize=False, unique=True
),
),
("name", models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name="Store",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("id_sp", models.CharField(db_index=True, max_length=32, unique=True)),
("postal_code", models.IntegerField(blank=True, null=True)),
(
"city",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="stores",
to="market.city",
),
),
(
"member",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="stores",
to="market.member",
),
),
(
"region",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="stores",
to="market.region",
),
),
],
),
migrations.CreateModel(
name="StoreExport",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("file", models.FileField(upload_to="exports/")),
(
"store",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="exports",
to="market.store",
),
),
],
),
migrations.AddField(
model_name="member",
name="region",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="members",
to="market.region",
),
),
migrations.CreateModel(
name="Item",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("gtin", models.CharField(db_index=True, max_length=32, unique=True)),
("product_name", models.CharField(max_length=250)),
("product_short_name", models.CharField(max_length=250)),
("tnved", models.IntegerField()),
("tnved10", models.IntegerField()),
("brand", models.CharField(max_length=250)),
("country", models.CharField(max_length=100)),
("volume", models.IntegerField()),
(
"member",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="items",
to="market.member",
),
),
],
),
]