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
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-10-21 10:03:04 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-10-21 10:04:14 +0300
commitdef48f0ad361dc7bc583ee0649d3f9f54a9dc274 (patch)
tree58f73e233c74c5f1d0f6757eb2604024fe8ba8b5
parent595fc4d9067bde2b4c133622275240ad1035ccd8 (diff)
Merge branch 'add-missing-migrations' into 'master'
Add missing migrations See merge request !1652
-rw-r--r--db/migrate/20151019111551_fix_build_tags.rb5
-rw-r--r--db/migrate/20151019111703_fail_build_without_names.rb5
-rw-r--r--db/migrate/20151020173906_add_ci_builds_index_for_status.rb5
-rw-r--r--db/schema.rb3
4 files changed, 17 insertions, 1 deletions
diff --git a/db/migrate/20151019111551_fix_build_tags.rb b/db/migrate/20151019111551_fix_build_tags.rb
new file mode 100644
index 00000000000..84b142183f8
--- /dev/null
+++ b/db/migrate/20151019111551_fix_build_tags.rb
@@ -0,0 +1,5 @@
+class FixBuildTags < ActiveRecord::Migration
+ def change
+ execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
+ end
+end
diff --git a/db/migrate/20151019111703_fail_build_without_names.rb b/db/migrate/20151019111703_fail_build_without_names.rb
new file mode 100644
index 00000000000..546b03d8129
--- /dev/null
+++ b/db/migrate/20151019111703_fail_build_without_names.rb
@@ -0,0 +1,5 @@
+class FailBuildWithoutNames < ActiveRecord::Migration
+ def change
+ execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
+ end
+end
diff --git a/db/migrate/20151020173906_add_ci_builds_index_for_status.rb b/db/migrate/20151020173906_add_ci_builds_index_for_status.rb
new file mode 100644
index 00000000000..c3f0e0606da
--- /dev/null
+++ b/db/migrate/20151020173906_add_ci_builds_index_for_status.rb
@@ -0,0 +1,5 @@
+class AddCiBuildsIndexForStatus < ActiveRecord::Migration
+ def change
+ add_index :ci_builds, [:commit_id, :status, :type]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b05fa708775..0fec00ebf8f 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: 20151016195706) do
+ActiveRecord::Schema.define(version: 20151020173906) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -110,6 +110,7 @@ ActiveRecord::Schema.define(version: 20151016195706) do
end
add_index "ci_builds", ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at", using: :btree
+ add_index "ci_builds", ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type", using: :btree
add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree
add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree
add_index "ci_builds", ["commit_id"], name: "index_ci_builds_on_commit_id", using: :btree