diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-25 00:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-25 00:09:48 +0300 |
commit | cfc6fe51003de30653a5ce48f1a1b7f46fc9075d (patch) | |
tree | 6bb54c97a01467a70dcd3e1909b03e02b6af31b8 /db | |
parent | aca82d5ba49a8d2cf7ca30ac4ee6dcbd62b47cff (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20200420162730_remove_additional_application_settings_rows.rb | 17 | ||||
-rw-r--r-- | db/structure.sql | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20200420162730_remove_additional_application_settings_rows.rb b/db/post_migrate/20200420162730_remove_additional_application_settings_rows.rb new file mode 100644 index 00000000000..e4a0ec1eb4a --- /dev/null +++ b/db/post_migrate/20200420162730_remove_additional_application_settings_rows.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveAdditionalApplicationSettingsRows < ActiveRecord::Migration[6.0] + class ApplicationSetting < ActiveRecord::Base + self.table_name = 'application_settings' + end + + def up + return if ApplicationSetting.count == 1 + + execute "DELETE from application_settings WHERE id NOT IN (SELECT MAX(id) FROM application_settings);" + end + + def down + # no changes + end +end diff --git a/db/structure.sql b/db/structure.sql index 96211531462..01c4f8fefa1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -13421,6 +13421,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200416120128 20200416120354 20200417044453 +20200420162730 20200420172113 20200420172752 20200420172927 |