Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-30 15:06:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-30 15:06:34 +0300
commit228d752ff09362002cc904d28edee7d63cc3cef2 (patch)
tree63e7ff466c0b0794f67c87c34e874f8682fb5de0 /db
parentb539ac1d619c0aafe5988ab8b125a8b43b14d87f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb15
-rw-r--r--db/post_migrate/20191021101942_remove_empty_github_service_templates.rb28
-rw-r--r--db/schema.rb6
3 files changed, 46 insertions, 3 deletions
diff --git a/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb b/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb
new file mode 100644
index 00000000000..9d19279510a
--- /dev/null
+++ b/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class SetApplicationSettingsDefaultProjectAndSnippetVisibility < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ change_column_null :application_settings, :default_project_visibility, false, 0
+ change_column_default :application_settings, :default_project_visibility, from: nil, to: 0
+
+ change_column_null :application_settings, :default_snippet_visibility, false, 0
+ change_column_default :application_settings, :default_snippet_visibility, from: nil, to: 0
+ end
+end
diff --git a/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb b/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb
new file mode 100644
index 00000000000..64abe93b3e8
--- /dev/null
+++ b/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+## It's expected to delete one record on GitLab.com
+#
+class RemoveEmptyGithubServiceTemplates < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ class Service < ActiveRecord::Base
+ self.table_name = 'services'
+ self.inheritance_column = :_type_disabled
+
+ serialize :properties, JSON
+ end
+
+ def up
+ relationship.where(properties: {}).delete_all
+ end
+
+ def down
+ relationship.find_or_create_by!(properties: {})
+ end
+
+ private
+
+ def relationship
+ RemoveEmptyGithubServiceTemplates::Service.where(template: true, type: 'GithubService')
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 09149cfbcfe..c4a541824c8 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_10_26_041447) do
+ActiveRecord::Schema.define(version: 2019_10_26_124116) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -158,8 +158,8 @@ ActiveRecord::Schema.define(version: 2019_10_26_041447) do
t.text "restricted_visibility_levels"
t.boolean "version_check_enabled", default: true
t.integer "max_attachment_size", default: 10, null: false
- t.integer "default_project_visibility"
- t.integer "default_snippet_visibility"
+ t.integer "default_project_visibility", default: 0, null: false
+ t.integer "default_snippet_visibility", default: 0, null: false
t.text "domain_whitelist"
t.boolean "user_oauth_applications", default: true
t.string "after_sign_out_path"