From 4b47d257556b5059167cbc58f6c624158783aae4 Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Thu, 3 Aug 2023 19:39:43 +0100 Subject: [PATCH] [AC-1360] Added EF scripts for MySQL, Postgres and Sqlite --- util/MySqlMigrations/MySqlMigrations.csproj | 1 + .../Scripts/2023-08-03_00_PopulateResellerNames.sql | 5 +++++ util/PostgresMigrations/PostgresMigrations.csproj | 1 + .../Scripts/2023-08-03_00_PopulateResellerNames.sql | 5 +++++ .../Scripts/2023-08-03_00_PopulateResellerNames.sql | 5 +++++ util/SqliteMigrations/SqliteMigrations.csproj | 4 ++++ 6 files changed, 21 insertions(+) create mode 100644 util/MySqlMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql create mode 100644 util/PostgresMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql create mode 100644 util/SqliteMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql diff --git a/util/MySqlMigrations/MySqlMigrations.csproj b/util/MySqlMigrations/MySqlMigrations.csproj index 7007f75c2..e0836f738 100644 --- a/util/MySqlMigrations/MySqlMigrations.csproj +++ b/util/MySqlMigrations/MySqlMigrations.csproj @@ -29,5 +29,6 @@ + diff --git a/util/MySqlMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql b/util/MySqlMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql new file mode 100644 index 000000000..d20b5bed7 --- /dev/null +++ b/util/MySqlMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql @@ -0,0 +1,5 @@ +-- Reseller Providers were being created with a NULL value in the `Name` column. +-- This script will populate them with the value from `BusinessName` which was already required. +UPDATE `Provider` +SET `Name` = `BusinessName` +WHERE `Name` IS NULL; diff --git a/util/PostgresMigrations/PostgresMigrations.csproj b/util/PostgresMigrations/PostgresMigrations.csproj index 8d3bed893..febec0cfe 100644 --- a/util/PostgresMigrations/PostgresMigrations.csproj +++ b/util/PostgresMigrations/PostgresMigrations.csproj @@ -24,5 +24,6 @@ + diff --git a/util/PostgresMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql b/util/PostgresMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql new file mode 100644 index 000000000..42c8e7d79 --- /dev/null +++ b/util/PostgresMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql @@ -0,0 +1,5 @@ +-- Reseller Providers were being created with a NULL value in the "Name" column. +-- This script will populate them with the value from "BusinessName" which was already required. +UPDATE "Provider" +SET "Name" = "BusinessName" +WHERE "Name" IS NULL; diff --git a/util/SqliteMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql b/util/SqliteMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql new file mode 100644 index 000000000..42c8e7d79 --- /dev/null +++ b/util/SqliteMigrations/Scripts/2023-08-03_00_PopulateResellerNames.sql @@ -0,0 +1,5 @@ +-- Reseller Providers were being created with a NULL value in the "Name" column. +-- This script will populate them with the value from "BusinessName" which was already required. +UPDATE "Provider" +SET "Name" = "BusinessName" +WHERE "Name" IS NULL; diff --git a/util/SqliteMigrations/SqliteMigrations.csproj b/util/SqliteMigrations/SqliteMigrations.csproj index 54a1dfecf..7ff8f17c3 100644 --- a/util/SqliteMigrations/SqliteMigrations.csproj +++ b/util/SqliteMigrations/SqliteMigrations.csproj @@ -22,4 +22,8 @@ + + + +