#358: cleanup build_lists table

This commit is contained in:
Vokhmin Alexey V 2014-02-20 01:31:25 +04:00
parent 4b1e0f2efd
commit 8ed84cc7e5
2 changed files with 5 additions and 1 deletions

View File

@ -8,9 +8,14 @@ class AddAutoPublishStatusToBuildList < ActiveRecord::Migration
add_column :build_lists, :auto_publish_status, :string, default: 'none', null: false add_column :build_lists, :auto_publish_status, :string, default: 'none', null: false
BuildList.where(auto_publish: true).update_all(auto_publish_status: :default) BuildList.where(auto_publish: true).update_all(auto_publish_status: :default)
change_column :build_lists, :auto_publish_status, :string, default: 'default', null: false change_column :build_lists, :auto_publish_status, :string, default: 'default', null: false
remove_column :build_lists, :auto_publish
end end
def down def down
# Make existing build_lists false, but default to true in the future.
add_column :build_lists, :auto_publish, :boolean, default: false
BuildList.where(auto_publish_status: :default).update_all(auto_publish: true)
change_column :build_lists, :auto_publish, :boolean, default: true
remove_column :build_lists, :auto_publish_status remove_column :build_lists, :auto_publish_status
end end
end end

View File

@ -122,7 +122,6 @@ ActiveRecord::Schema.define(:version => 20140219191644) do
t.integer "save_to_platform_id" t.integer "save_to_platform_id"
t.text "include_repos" t.text "include_repos"
t.integer "user_id" t.integer "user_id"
t.boolean "auto_publish", :default => true
t.string "package_version" t.string "package_version"
t.string "commit_hash" t.string "commit_hash"
t.integer "priority", :default => 0, :null => false t.integer "priority", :default => 0, :null => false