feat: added sku and resetted migrations
This commit is contained in:
+326
-43
@@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.0.3 on 2024-04-24 14:00
|
||||
# Generated by Django 5.0.6 on 2024-05-21 17:19
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
@@ -11,9 +11,47 @@ class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
dependencies = [
|
||||
("files", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Brand",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(
|
||||
max_length=100, unique=True, verbose_name="Nombre"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "marca",
|
||||
"verbose_name_plural": "marcas",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Customer",
|
||||
fields=[
|
||||
@@ -26,6 +64,18 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"vat_id",
|
||||
models.CharField(
|
||||
@@ -47,12 +97,12 @@ class Migration(migrations.Migration):
|
||||
("zip", models.CharField(max_length=32, verbose_name="Código postal")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Cliente",
|
||||
"verbose_name_plural": "Clientes",
|
||||
"verbose_name": "cliente",
|
||||
"verbose_name_plural": "clientes",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Product",
|
||||
name="Provider",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
@@ -63,38 +113,72 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=96, verbose_name="Nombre")),
|
||||
(
|
||||
"description",
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"vat_id",
|
||||
models.CharField(
|
||||
max_length=32,
|
||||
unique=True,
|
||||
verbose_name="Documento de identidad",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=64, verbose_name="Nombre")),
|
||||
(
|
||||
"email",
|
||||
models.EmailField(
|
||||
max_length=254, verbose_name="E-mail de contacto"
|
||||
),
|
||||
),
|
||||
(
|
||||
"phone",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=1000,
|
||||
verbose_name="Descripción",
|
||||
),
|
||||
),
|
||||
(
|
||||
"stock",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Stock",
|
||||
),
|
||||
),
|
||||
(
|
||||
"unit",
|
||||
models.CharField(
|
||||
choices=[("UNIT", "Unidad"), ("KG", "kg"), ("L", "L")],
|
||||
default="UNIT",
|
||||
max_length=6,
|
||||
verbose_name="Unidad de medida",
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="Teléfono de contacto",
|
||||
),
|
||||
),
|
||||
("address", models.CharField(max_length=255, verbose_name="Dirección")),
|
||||
("city", models.CharField(max_length=64, verbose_name="Ciudad")),
|
||||
("state", models.CharField(max_length=64, verbose_name="Región")),
|
||||
("country", models.CharField(max_length=64, verbose_name="País")),
|
||||
("zip", models.CharField(max_length=32, verbose_name="Código postal")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Producto",
|
||||
"verbose_name_plural": "Productos",
|
||||
"verbose_name": "proveedor",
|
||||
"verbose_name_plural": "proveedores",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Tag",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=16)),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "etiqueta",
|
||||
"verbose_name_plural": "etiquetas",
|
||||
"ordering": ("name",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -109,6 +193,18 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"code",
|
||||
models.CharField(
|
||||
@@ -123,8 +219,8 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Impuesto",
|
||||
"verbose_name_plural": "Impuestos",
|
||||
"verbose_name": "impuesto",
|
||||
"verbose_name_plural": "impuestos",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -139,12 +235,6 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"uuid",
|
||||
models.UUIDField(
|
||||
db_index=True, default=uuid.uuid4, verbose_name="UUID"
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
@@ -157,6 +247,18 @@ class Migration(migrations.Migration):
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"uuid",
|
||||
models.UUIDField(
|
||||
db_index=True, default=uuid.uuid4, verbose_name="UUID"
|
||||
),
|
||||
),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
default="PEN", max_length=3, verbose_name="Estado"
|
||||
),
|
||||
),
|
||||
(
|
||||
"base_total",
|
||||
models.DecimalField(
|
||||
@@ -239,8 +341,88 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Pedido",
|
||||
"verbose_name_plural": "Pedidos",
|
||||
"verbose_name": "pedido",
|
||||
"verbose_name_plural": "pedidos",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Product",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"sku",
|
||||
models.CharField(
|
||||
max_length=64, unique=True, verbose_name="Código de referencia"
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=96, verbose_name="Nombre")),
|
||||
(
|
||||
"description",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
default="",
|
||||
max_length=1000,
|
||||
verbose_name="Descripción",
|
||||
),
|
||||
),
|
||||
(
|
||||
"stock",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Stock",
|
||||
),
|
||||
),
|
||||
("is_digital_asset", models.BooleanField(default=False)),
|
||||
("url", models.URLField(blank=True, verbose_name="URL de descarga")),
|
||||
(
|
||||
"brand",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.brand",
|
||||
verbose_name="Marca",
|
||||
),
|
||||
),
|
||||
(
|
||||
"images",
|
||||
models.ManyToManyField(
|
||||
blank=True, to="files.fileupload", verbose_name="Imágenes"
|
||||
),
|
||||
),
|
||||
(
|
||||
"tags",
|
||||
models.ManyToManyField(
|
||||
blank=True, to="shop.tag", verbose_name="Etiquetas"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "producto",
|
||||
"verbose_name_plural": "productos",
|
||||
"ordering": ("-id",),
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -255,6 +437,18 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.DecimalField(
|
||||
@@ -314,8 +508,79 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Línea de pedido",
|
||||
"verbose_name_plural": "Líneas de pedido",
|
||||
"verbose_name": "línea de pedido",
|
||||
"verbose_name_plural": "líneas de pedido",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="ProductBatch",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"code",
|
||||
models.CharField(
|
||||
db_index=True, max_length=32, unique=True, verbose_name="Código"
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="Cantidad",
|
||||
),
|
||||
),
|
||||
(
|
||||
"expiration_date",
|
||||
models.DateField(
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="Fecha de caducidad / consumo preferente",
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT,
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
),
|
||||
),
|
||||
(
|
||||
"provider",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
to="shop.provider",
|
||||
verbose_name="Proveedor",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "remesa de producto",
|
||||
"verbose_name_plural": "remesas de productos",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
@@ -330,6 +595,18 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Fecha de creación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"last_modification_date",
|
||||
models.DateTimeField(
|
||||
auto_now=True, verbose_name="Fecha de última modificación"
|
||||
),
|
||||
),
|
||||
(
|
||||
"price",
|
||||
models.DecimalField(
|
||||
@@ -342,6 +619,12 @@ class Migration(migrations.Migration):
|
||||
default=django.utils.timezone.now, verbose_name="Fecha"
|
||||
),
|
||||
),
|
||||
(
|
||||
"current",
|
||||
models.BooleanField(
|
||||
default=False, verbose_name="Es el precio actual"
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
@@ -361,8 +644,8 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Precio de producto",
|
||||
"verbose_name_plural": "Precio de producto",
|
||||
"verbose_name": "precio de producto",
|
||||
"verbose_name_plural": "precio de producto",
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user