From 752aa70924f997b9a78644f437df08ad336cc17c Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Thu, 15 Jul 2021 11:39:54 -0400 Subject: [PATCH] Setup naming convention for Entity Framework migrations (#1464) --- .../Scripts/{Init.sql => 2021-07-08_00_Init.sql} | 0 ...9_00_RemoveProviderOrganizationProviderUser.sql | 14 ++++++++++++++ .../Scripts/{Init.psql => 2021-07-08_00_Init.psql} | 0 ..._00_RemoveProviderOrganizationProviderUser.psql | 12 ++++++++++++ 4 files changed, 26 insertions(+) rename util/MySqlMigrations/Scripts/{Init.sql => 2021-07-08_00_Init.sql} (100%) create mode 100644 util/MySqlMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.sql rename util/PostgresMigrations/Scripts/{Init.psql => 2021-07-08_00_Init.psql} (100%) create mode 100644 util/PostgresMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.psql diff --git a/util/MySqlMigrations/Scripts/Init.sql b/util/MySqlMigrations/Scripts/2021-07-08_00_Init.sql similarity index 100% rename from util/MySqlMigrations/Scripts/Init.sql rename to util/MySqlMigrations/Scripts/2021-07-08_00_Init.sql diff --git a/util/MySqlMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.sql b/util/MySqlMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.sql new file mode 100644 index 0000000000..c17fdd8b9c --- /dev/null +++ b/util/MySqlMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.sql @@ -0,0 +1,14 @@ +START TRANSACTION; + +DROP TABLE `ProviderOrganizationProviderUser`; + +ALTER TABLE `Provider` ADD `UseEvents` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `Event` ADD `ProviderId` char(36) COLLATE ascii_general_ci NULL; + +ALTER TABLE `Event` ADD `ProviderUserId` char(36) COLLATE ascii_general_ci NULL; + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20210709095522_RemoveProviderOrganizationProviderUser', '5.0.5'); + +COMMIT; diff --git a/util/PostgresMigrations/Scripts/Init.psql b/util/PostgresMigrations/Scripts/2021-07-08_00_Init.psql similarity index 100% rename from util/PostgresMigrations/Scripts/Init.psql rename to util/PostgresMigrations/Scripts/2021-07-08_00_Init.psql diff --git a/util/PostgresMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.psql b/util/PostgresMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.psql new file mode 100644 index 0000000000..68e08dc405 --- /dev/null +++ b/util/PostgresMigrations/Scripts/2021-07-09_00_RemoveProviderOrganizationProviderUser.psql @@ -0,0 +1,12 @@ +START TRANSACTION; + +DROP TABLE "ProviderOrganizationProviderUser"; + +ALTER TABLE "Event" ADD "ProviderId" uuid NULL; + +ALTER TABLE "Event" ADD "ProviderUserId" uuid NULL; + +INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") +VALUES ('20210709092227_RemoveProviderOrganizationProviderUser', '5.0.5'); + +COMMIT;