From fa5f96d8f6337866dff8e0b4bac0dce2cdf161be Mon Sep 17 00:00:00 2001 From: Andreas Brandl Date: Thu, 24 Jun 2021 11:04:03 +0200 Subject: [PATCH] Example migration for normalization testing --- ...igration-to-test-query-normalization.patch | 39 +++++++++++++++++++ docker/gitlab/prepare.sh | 1 + 2 files changed, 40 insertions(+) create mode 100644 docker/gitlab/patches/testing/Migration-to-test-query-normalization.patch diff --git a/docker/gitlab/patches/testing/Migration-to-test-query-normalization.patch b/docker/gitlab/patches/testing/Migration-to-test-query-normalization.patch new file mode 100644 index 00000000..24e68345 --- /dev/null +++ b/docker/gitlab/patches/testing/Migration-to-test-query-normalization.patch @@ -0,0 +1,39 @@ +From 676a7f23e5259ea5ed2d8bb0fbf4e4cf64d0fca0 Mon Sep 17 00:00:00 2001 +From: Andreas Brandl +Date: Thu, 24 Jun 2021 11:02:59 +0200 +Subject: [PATCH] Migration to test query normalization + +--- + db/migrate/20210624084836_query_normalization_test.rb | 10 ++++++++++ + db/schema_migrations/20210624084836 | 1 + + 2 files changed, 11 insertions(+) + create mode 100644 db/migrate/20210624084836_query_normalization_test.rb + create mode 100644 db/schema_migrations/20210624084836 + +diff --git a/db/migrate/20210624084836_query_normalization_test.rb b/db/migrate/20210624084836_query_normalization_test.rb +new file mode 100644 +index 00000000000..7f729803311 +--- /dev/null ++++ b/db/migrate/20210624084836_query_normalization_test.rb +@@ -0,0 +1,10 @@ ++# frozen_string_literal: true ++ ++class QueryNormalizationTest < ActiveRecord::Migration[6.1] ++ def up ++ execute "SELECT 'random-literal-value-4711'" ++ end ++ ++ def down ++ end ++end +diff --git a/db/schema_migrations/20210624084836 b/db/schema_migrations/20210624084836 +new file mode 100644 +index 00000000000..93ad43c90ce +--- /dev/null ++++ b/db/schema_migrations/20210624084836 +@@ -0,0 +1 @@ ++a82193ac2bf8da7ba3a25b0ce74ee309d82c08d486383b51fbbb0d19374e4072 +\ No newline at end of file +-- +2.31.1 + diff --git a/docker/gitlab/prepare.sh b/docker/gitlab/prepare.sh index f925ce1a..243bf42b 100755 --- a/docker/gitlab/prepare.sh +++ b/docker/gitlab/prepare.sh @@ -22,6 +22,7 @@ if test "$VALIDATION_PIPELINE"; then git am < /gitlab/patches/testing/Drop-table-in-post-migration.patch git am < /gitlab/patches/testing/Exception-Raised-in-Migration.patch git am < /gitlab/patches/testing/Add-a-migration-that-takes-five-seconds.patch + git am < /gitlab/patches/testing/Migration-to-test-query-normalization.patch fi cp config/cable.yml.example config/cable.yml -- GitLab