[refs #442] Slice counters migration on two parts

This commit is contained in:
konstantin.grabar 2012-07-03 14:24:14 +04:00
parent c7232c53e9
commit dbbe4cef1f
3 changed files with 23 additions and 13 deletions

View File

@ -1,10 +1,10 @@
class AddCountersToMassBuilds < ActiveRecord::Migration
def change
add_column :mass_builds, :build_lists_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_published_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_pending_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_started_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_publish_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_error_count, :integer, :default => 0, :null => false
add_column :mass_builds, :build_lists_count, :integer, :default => 0
add_column :mass_builds, :build_published_count, :integer, :default => 0
add_column :mass_builds, :build_pending_count, :integer, :default => 0
add_column :mass_builds, :build_started_count, :integer, :default => 0
add_column :mass_builds, :build_publish_count, :integer, :default => 0
add_column :mass_builds, :build_error_count, :integer, :default => 0
end
end

View File

@ -0,0 +1,10 @@
class AddNullFalseToMassBuildsCounters < ActiveRecord::Migration
def change
change_column :mass_builds, :build_lists_count, :integer, :default => 0, :null => false
change_column :mass_builds, :build_published_count, :integer, :default => 0, :null => false
change_column :mass_builds, :build_pending_count, :integer, :default => 0, :null => false
change_column :mass_builds, :build_started_count, :integer, :default => 0, :null => false
change_column :mass_builds, :build_publish_count, :integer, :default => 0, :null => false
change_column :mass_builds, :build_error_count, :integer, :default => 0, :null => false
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120629134216) do
ActiveRecord::Schema.define(:version => 20120703101719) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
@ -204,12 +204,12 @@ ActiveRecord::Schema.define(:version => 20120629134216) do
t.string "arch_names"
t.integer "user_id"
t.boolean "auto_publish", :default => false, :null => false
t.integer "build_lists_count", :default => 0
t.integer "build_published_count", :default => 0
t.integer "build_pending_count", :default => 0
t.integer "build_started_count", :default => 0
t.integer "build_publish_count", :default => 0
t.integer "build_error_count", :default => 0
t.integer "build_lists_count", :default => 0, :null => false
t.integer "build_published_count", :default => 0, :null => false
t.integer "build_pending_count", :default => 0, :null => false
t.integer "build_started_count", :default => 0, :null => false
t.integer "build_publish_count", :default => 0, :null => false
t.integer "build_error_count", :default => 0, :null => false
t.string "rep_names"
t.boolean "stop_build", :default => false, :null => false
end