Skip to content

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

Create temporary vatlayer tables (#13908)

Krzysztof Waliczeked8ed36dfce3
diff --git a/saleor/core/migrations/0009_add_temporary_vatlayer_tables.py b/saleor/core/migrations/0009_add_temporary_vatlayer_tables.py
new file mode 100644
index 0000000000..79b9f81f9f
--- /dev/null
+++ b/saleor/core/migrations/0009_add_temporary_vatlayer_tables.py
@@ -0,0 +1,38 @@
+# Generated by Django 3.2.20 on 2023-09-06 12:02
+
+# Create tables that were used by package that is no longer used:
+# - `django-prices-vatlayer` - removed in https://github.com/saleor/saleor/pull/13179/
+
+# Creation of the tables is needed for schema consistency for replication.
+# Normally we would be removing those tables, but cause of zero-downtime policy
+# they cannot be removed from database until 3.16 version.
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("core", "0008_drop_openexchangerates_table"),
+ ]
+
+ operations = [
+ migrations.RunSQL(
+ sql="""
+ CREATE TABLE IF NOT EXISTS django_prices_vatlayer_ratetypes(
+ "id" serial4 NOT NULL PRIMARY KEY,
+ "types" text NOT NULL
+ );
+ """,
+ reverse_sql=migrations.RunSQL.noop,
+ ),
+ migrations.RunSQL(
+ sql="""
+ CREATE TABLE IF NOT EXISTS django_prices_vatlayer_vat(
+ "id" serial4 NOT NULL PRIMARY KEY,
+ "country_code" varchar(2) NOT NULL,
+ "data" text NOT NULL
+ );
+ """,
+ reverse_sql=migrations.RunSQL.noop,
+ ),
+ ]
diff --git a/saleor/core/migrations/0009_drop_vatlayer_tables.py b/saleor/core/migrations/0010_drop_vatlayer_tables.py
similarity index 92%
rename from saleor/core/migrations/0009_drop_vatlayer_tables.py
rename to saleor/core/migrations/0010_drop_vatlayer_tables.py
index ba5edfa212..80cb326003 100644
--- a/saleor/core/migrations/0009_drop_vatlayer_tables.py
+++ b/saleor/core/migrations/0010_drop_vatlayer_tables.py
@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
- ("core", "0008_drop_openexchangerates_table"),
+ ("core", "0009_add_temporary_vatlayer_tables"),
("tax", "0007_auto_20230217_0837"),
]