Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Squash csv migrations

IKarbowiaka9b89bd4d930
diff --git a/saleor/csv/migrations/0001_initial.py b/saleor/csv/migrations/0001_initial.py
index 981c25c82b..ec13de7739 100644
--- a/saleor/csv/migrations/0001_initial.py
+++ b/saleor/csv/migrations/0001_initial.py
@@ -1,9 +1,13 @@
-# Generated by Django 3.0.5 on 2020-05-04 07:43
+# Generated by Django 3.0.6 on 2020-06-05 07:00
+import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
+import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
+import saleor.core.utils.json_serializer
+
class Migration(migrations.Migration):
@@ -41,7 +45,7 @@ class Migration(migrations.Migration):
),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
- ("content_file", models.FileField(null=True, upload_to="csv_files")),
+ ("content_file", models.FileField(null=True, upload_to="export_files")),
(
"created_by",
models.ForeignKey(
@@ -53,4 +57,73 @@ class Migration(migrations.Migration):
],
options={"abstract": False},
),
+ migrations.CreateModel(
+ name="ExportEvent",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ (
+ "date",
+ models.DateTimeField(
+ default=django.utils.timezone.now, editable=False
+ ),
+ ),
+ (
+ "type",
+ models.CharField(
+ choices=[
+ ("export_pending", "Data export was started."),
+ (
+ "export_success",
+ "Data export was completed successfully.",
+ ),
+ ("export_failed", "Data export failed."),
+ ("export_deleted", "Export file was started."),
+ (
+ "exported_file_sent",
+ "Email with link to download file was sent to the "
+ "customer.",
+ ),
+ (
+ "Export_failed_info_sent",
+ "Email with info that export failed was sent to the "
+ "customer.",
+ ),
+ ],
+ max_length=255,
+ ),
+ ),
+ (
+ "parameters",
+ django.contrib.postgres.fields.jsonb.JSONField(
+ blank=True,
+ default=dict,
+ encoder=saleor.core.utils.json_serializer.CustomJsonEncoder,
+ ),
+ ),
+ (
+ "export_file",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="events",
+ to="csv.ExportFile",
+ ),
+ ),
+ (
+ "user",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="export_csv_events",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ ],
+ ),
]
diff --git a/saleor/csv/migrations/0002_exportevent.py b/saleor/csv/migrations/0002_exportevent.py
deleted file mode 100644
index 9a35244f88..0000000000
--- a/saleor/csv/migrations/0002_exportevent.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# Generated by Django 3.0.5 on 2020-05-11 11:29
-
-import django.contrib.postgres.fields.jsonb
-import django.db.models.deletion
-import django.utils.timezone
-from django.conf import settings
-from django.db import migrations, models
-
-import saleor.core.utils.json_serializer
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("csv", "0001_initial"),
- ]
-
- operations = [
- migrations.CreateModel(
- name="ExportEvent",
- fields=[
- (
- "id",
- models.AutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- (
- "date",
- models.DateTimeField(
- default=django.utils.timezone.now, editable=False
- ),
- ),
- (
- "type",
- models.CharField(
- choices=[
- ("export_pending", "Data export was started."),
- (
- "export_success",
- "Data export was completed successfully.",
- ),
- ("export_failed", "Data export failed."),
- ("export_deleted", "Export file was started."),
- (
- "exported_file_sent",
- "Email with link to download csv file was sent "
- "to the customer.",
- ),
- ],
- max_length=255,
- ),
- ),
- (
- "parameters",
- django.contrib.postgres.fields.jsonb.JSONField(
- blank=True,
- default=dict,
- encoder=saleor.core.utils.json_serializer.CustomJsonEncoder,
- ),
- ),
- (
- "export_file",
- models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- related_name="events",
- to="csv.ExportFile",
- ),
- ),
- (
- "user",
- models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- related_name="export_csv_events",
- to=settings.AUTH_USER_MODEL,
- ),
- ),
- ],
- ),
- ]
diff --git a/saleor/csv/migrations/0003_auto_20200520_0247.py b/saleor/csv/migrations/0003_auto_20200520_0247.py
deleted file mode 100644
index 17a828397a..0000000000
--- a/saleor/csv/migrations/0003_auto_20200520_0247.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 3.0.6 on 2020-05-20 07:47
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("csv", "0002_exportevent"),
- ]
-
- operations = [
- migrations.AlterField(
- model_name="exportfile",
- name="content_file",
- field=models.FileField(null=True, upload_to="export_files"),
- ),
- ]
diff --git a/saleor/csv/migrations/0004_auto_20200604_0633.py b/saleor/csv/migrations/0004_auto_20200604_0633.py
deleted file mode 100644
index fb36d23fd8..0000000000
--- a/saleor/csv/migrations/0004_auto_20200604_0633.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated by Django 3.0.6 on 2020-06-04 11:33
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("csv", "0003_auto_20200520_0247"),
- ]
-
- operations = [
- migrations.AlterField(
- model_name="exportevent",
- name="type",
- field=models.CharField(
- choices=[
- ("export_pending", "Data export was started."),
- ("export_success", "Data export was completed successfully."),
- ("export_failed", "Data export failed."),
- ("export_deleted", "Export file was started."),
- (
- "exported_file_sent",
- "Email with link to download file was sent to the customer.",
- ),
- (
- "Export_failed_info_sent",
- "Email with info that export failed was sent to the customer.",
- ),
- ],
- max_length=255,
- ),
- ),
- ]