Commit 802087c937d844d061cacff7fe1d44fd044ee91f
1 parent
c898dc00
Exists in
spb-stable
and in
3 other branches
Changed default in the database for the statemachine
Showing
3 changed files
with
13 additions
and
4 deletions
Show diff stats
app/models/merge_request_diff.rb
... | ... | @@ -26,7 +26,7 @@ class MergeRequestDiff < ActiveRecord::Base |
26 | 26 | |
27 | 27 | delegate :target_branch, :source_branch, to: :merge_request, prefix: nil |
28 | 28 | |
29 | - state_machine :state, initial: :collected do | |
29 | + state_machine :state, initial: :empty do | |
30 | 30 | state :collected |
31 | 31 | state :timeout |
32 | 32 | state :overflow_commits_safe_size | ... | ... |
db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
0 → 100644
... | ... | @@ -0,0 +1,9 @@ |
1 | +class ChangeStateToAllowEmptyMergeRequestDiffs < ActiveRecord::Migration | |
2 | + def up | |
3 | + change_column :merge_request_diffs, :state, :string, null: true, default: nil | |
4 | + end | |
5 | + | |
6 | + def down | |
7 | + change_column :merge_request_diffs, :state, :string, null: false, default: "collected" | |
8 | + end | |
9 | +end | ... | ... |
db/schema.rb
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | # |
12 | 12 | # It's strongly recommended that you check this file into your version control system. |
13 | 13 | |
14 | -ActiveRecord::Schema.define(version: 20140407135544) do | |
14 | +ActiveRecord::Schema.define(version: 20140414131055) do | |
15 | 15 | |
16 | 16 | # These are extensions that must be enabled in order to support this database |
17 | 17 | enable_extension "plpgsql" |
... | ... | @@ -109,10 +109,10 @@ ActiveRecord::Schema.define(version: 20140407135544) do |
109 | 109 | add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree |
110 | 110 | |
111 | 111 | create_table "merge_request_diffs", force: true do |t| |
112 | - t.string "state", default: "collected", null: false | |
112 | + t.string "state" | |
113 | 113 | t.text "st_commits" |
114 | 114 | t.text "st_diffs" |
115 | - t.integer "merge_request_id", null: false | |
115 | + t.integer "merge_request_id", null: false | |
116 | 116 | t.datetime "created_at" |
117 | 117 | t.datetime "updated_at" |
118 | 118 | end | ... | ... |