Skip to content
Snippets Groups Projects
Commit 433de7ba authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Grzegorz Bizon
Browse files

Remove boolean erase column from ci build and foreign key

parent ede451c8
No related branches found
No related tags found
No related merge requests found
Loading
@@ -31,7 +31,6 @@
Loading
@@ -31,7 +31,6 @@
# artifacts_file :text # artifacts_file :text
# gl_project_id :integer # gl_project_id :integer
# artifacts_metadata :text # artifacts_metadata :text
# erased :boolean default(FALSE)
# erased_by_id :integer # erased_by_id :integer
# erased_at :datetime # erased_at :datetime
# #
Loading
Loading
Loading
@@ -35,7 +35,6 @@ module Ci
Loading
@@ -35,7 +35,6 @@ module Ci
def update_erased!(user = nil) def update_erased!(user = nil)
self.erased_by = user if user self.erased_by = user if user
self.erased_at = Time.now self.erased_at = Time.now
self.erased = true
self.save! self.save!
end end
end end
Loading
Loading
class AddEraseableToCiBuild < ActiveRecord::Migration class AddEraseableToCiBuild < ActiveRecord::Migration
def change def change
add_column :ci_builds, :erased, :boolean, default: false
add_reference :ci_builds, :erased_by, references: :users, index: true add_reference :ci_builds, :erased_by, references: :users, index: true
add_foreign_key :ci_builds, :users, column: :erased_by_id
add_column :ci_builds, :erased_at, :datetime add_column :ci_builds, :erased_at, :datetime
end end
end end
Loading
@@ -129,7 +129,6 @@ ActiveRecord::Schema.define(version: 20160209130428) do
Loading
@@ -129,7 +129,6 @@ ActiveRecord::Schema.define(version: 20160209130428) do
t.text "artifacts_file" t.text "artifacts_file"
t.integer "gl_project_id" t.integer "gl_project_id"
t.text "artifacts_metadata" t.text "artifacts_metadata"
t.boolean "erased", default: false
t.integer "erased_by_id" t.integer "erased_by_id"
t.datetime "erased_at" t.datetime "erased_at"
end end
Loading
@@ -923,5 +922,4 @@ ActiveRecord::Schema.define(version: 20160209130428) do
Loading
@@ -923,5 +922,4 @@ ActiveRecord::Schema.define(version: 20160209130428) do
add_index "web_hooks", ["created_at", "id"], name: "index_web_hooks_on_created_at_and_id", using: :btree add_index "web_hooks", ["created_at", "id"], name: "index_web_hooks_on_created_at_and_id", using: :btree
add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
   
add_foreign_key "ci_builds", "users", column: "erased_by_id"
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment