-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug #557: Fixed new (similar) bug if grate schemas/tables exist with …
…different casing for PostgreSQL and MariaDB> (#560) There was a regression, a similar bug to #245 which was introduced when using SQL scripts to handle the grate table structure versioning (grate the grate), in release 1.7.0. This should fix it. Fixes #557
- Loading branch information
Showing
10 changed files
with
199 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/grate.mariadb/Bootstrapping/Sql/GrateStructure/up/00_02_fix_version_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE IF EXISTS `{{SchemaName}}_{{VersionTableLowerCase}}` | ||
RENAME TO `{{SchemaName}}_{{VersionTable}}` |
2 changes: 2 additions & 0 deletions
2
src/grate.mariadb/Bootstrapping/Sql/GrateStructure/up/00_03_fix_scriptsrun_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE IF EXISTS `{{SchemaName}}_{{ScriptsRunTableLowerCase}}` | ||
RENAME TO `{{SchemaName}}_{{ScriptsRunTable}}` |
2 changes: 2 additions & 0 deletions
2
...e.mariadb/Bootstrapping/Sql/GrateStructure/up/00_03_fix_scriptsrunerrors_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE IF EXISTS `{{SchemaName}}_{{ScriptsRunErrorsTableLowerCase}}` | ||
RENAME TO `{{SchemaName}}_{{ScriptsRunErrorsTable}}` |
7 changes: 7 additions & 0 deletions
7
src/grate.postgresql/Bootstrapping/Sql/GrateStructure/up/00_01_fix_schema_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DO LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
ALTER SCHEMA {{SchemaName}} RENAME TO "{{SchemaName}}"; | ||
EXCEPTION WHEN duplicate_schema or invalid_schema_name THEN | ||
END; | ||
$$; |
7 changes: 7 additions & 0 deletions
7
src/grate.postgresql/Bootstrapping/Sql/GrateStructure/up/00_02_fix_version_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DO LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
ALTER TABLE "{{SchemaName}}"."{{VersionTableLowerCase}}" RENAME TO "{{VersionTable}}"; | ||
EXCEPTION WHEN undefined_table or duplicate_table THEN | ||
END; | ||
$$; |
7 changes: 7 additions & 0 deletions
7
...rate.postgresql/Bootstrapping/Sql/GrateStructure/up/00_03_fix_scriptsrun_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DO LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
ALTER TABLE "{{SchemaName}}"."{{ScriptsRunTableLowerCase}}" RENAME TO "{{ScriptsRunTable}}"; | ||
EXCEPTION WHEN undefined_table or duplicate_table THEN | ||
END; | ||
$$; |
7 changes: 7 additions & 0 deletions
7
...ostgresql/Bootstrapping/Sql/GrateStructure/up/00_03_fix_scriptsrunerrors_table_casing.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DO LANGUAGE plpgsql | ||
$$ | ||
BEGIN | ||
ALTER TABLE "{{SchemaName}}"."{{ScriptsRunErrorsTableLowerCase}}" RENAME TO "{{ScriptsRunErrorsTable}}"; | ||
EXCEPTION WHEN undefined_table or duplicate_table THEN | ||
END; | ||
$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters