summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-02-16 18:49:07 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-02-16 18:49:07 +0800
commit4789fe25fd84e6ec01592728d5c1b28862eec7cf (patch)
tree385faa65a37b1206175d8db2be0cdf9d67cddfb3 /db
parentb72f00c7cfdc854640cbb118c741a116ae4fd8ba (diff)
parent1b6a671eb5c9b4a440a07e56aad8e30b1dfe852f (diff)
downloadgitlab-ce-4789fe25fd84e6ec01592728d5c1b28862eec7cf.tar.gz
Merge remote-tracking branch 'upstream/master' into 27762-add-default-artifacts-expiration
* upstream/master: (37 commits) Show merge errors in merge request widget Clarify that stage is needed to stop environments Fix broken link in university docs allow clicking on text or icon to trigger expand style links on system notes to look clickable Clean up terms used for issues. Use New instead of Add. Fix most of broken docs links Set `Auto-Submitted: auto-generated` header to emails Fix Rubocop offense Fix regression where cmd-click stopped working for todos and merge request tabs Remove changelog entries for 8.16.5 release Merge branch 'fix-github-import-MR-wrong-project' into 'security' Merge branch 'svg-xss-fix' into 'security' Merge branch 'fix-rdoc-xss' into 'security' Merge branch 'asciidoctor-xss-patch' into 'security' Specify that only project owners can transfer a project only load istanbul plugin in development mode Make Karma output look nicer for CI (!9165) Centers loading icon vertically and horizontally in pipelines table in commit view Rename builds to jobs in docs ...
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20170211073944_disable_invalid_service_templates.rb15
-rw-r--r--db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb15
-rw-r--r--db/schema.rb4
3 files changed, 32 insertions, 2 deletions
diff --git a/db/post_migrate/20170211073944_disable_invalid_service_templates.rb b/db/post_migrate/20170211073944_disable_invalid_service_templates.rb
new file mode 100644
index 00000000000..84954b1ef64
--- /dev/null
+++ b/db/post_migrate/20170211073944_disable_invalid_service_templates.rb
@@ -0,0 +1,15 @@
+class DisableInvalidServiceTemplates < ActiveRecord::Migration
+ DOWNTIME = false
+
+ unless defined?(Service)
+ class Service < ActiveRecord::Base
+ self.inheritance_column = nil
+ end
+ end
+
+ def up
+ Service.where(template: true, active: true).each do |template|
+ template.update(active: false) unless template.valid?
+ end
+ end
+end
diff --git a/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb b/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb
new file mode 100644
index 00000000000..09a827d22b0
--- /dev/null
+++ b/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb
@@ -0,0 +1,15 @@
+class DeleteDeprecatedGitlabCiService < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ disable_statement_timeout
+
+ execute("DELETE FROM services WHERE type = 'GitlabCiService';")
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index d421d5c6774..52672406ec6 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170210075922) do
+ActiveRecord::Schema.define(version: 20170214111112) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1351,4 +1351,4 @@ ActiveRecord::Schema.define(version: 20170210075922) do
add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade
add_foreign_key "trending_projects", "projects", on_delete: :cascade
add_foreign_key "u2f_registrations", "users"
-end
+end \ No newline at end of file