summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2014-12-01 06:00:13 -0500
committerValery Sizov <valery@gitlab.com>2014-12-01 06:00:13 -0500
commit05e6e8b9a0ac22c4b322bc4a36e638bf34df51d5 (patch)
tree81153962fbbd18de8743244fc19a5dcfb86c58ac /db
parentc6609d8447dc8440c0ee2b7b29ac369d4fcaad98 (diff)
downloadgitlab-ci-05e6e8b9a0ac22c4b322bc4a36e638bf34df51d5.tar.gz
remove invalid builds
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20141201153755_remove_invalid_build.rb5
-rw-r--r--db/schema.rb7
2 files changed, 7 insertions, 5 deletions
diff --git a/db/migrate/20141201153755_remove_invalid_build.rb b/db/migrate/20141201153755_remove_invalid_build.rb
new file mode 100644
index 0000000..a3a6503
--- /dev/null
+++ b/db/migrate/20141201153755_remove_invalid_build.rb
@@ -0,0 +1,5 @@
+class RemoveInvalidBuild < ActiveRecord::Migration
+ def change
+ execute "DELETE FROM builds WHERE commit_id is NULL"
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 73830b6..5dbf408 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,10 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20141104153744) do
-
- # These are extensions that must be enabled in order to support this database
- enable_extension "plpgsql"
+ActiveRecord::Schema.define(version: 20141201153755) do
create_table "builds", force: true do |t|
t.integer "project_id"
@@ -55,7 +52,7 @@ ActiveRecord::Schema.define(version: 20141104153744) do
add_index "commits", ["project_id", "sha"], name: "index_commits_on_project_id_and_sha", using: :btree
add_index "commits", ["project_id"], name: "index_commits_on_project_id", using: :btree
- add_index "commits", ["sha"], name: "index_commits_on_sha", using: :btree
+ add_index "commits", ["sha"], name: "index_commits_on_sha", length: {"sha"=>6}, using: :btree
create_table "jobs", force: true do |t|
t.integer "project_id", null: false