From 76c5c86c279c413d00bfc7b4247e752298d6cd0b Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Wed, 30 Nov 2011 21:03:58 +0200 Subject: [PATCH] Add db default value for build_lists field build_requires. Refs #2261 --- app/controllers/platforms_controller.rb | 2 +- ...01_change_build_lists_build_requires_default_value.rb | 9 +++++++++ db/schema.rb | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20111130181101_change_build_lists_build_requires_default_value.rb diff --git a/app/controllers/platforms_controller.rb b/app/controllers/platforms_controller.rb index cd40d943f..30c40ccc5 100644 --- a/app/controllers/platforms_controller.rb +++ b/app/controllers/platforms_controller.rb @@ -15,7 +15,7 @@ class PlatformsController < ApplicationController bl.update_type = 'recommended' bl.arch = Arch.find_by_name('i586') bl.project_version = "latest_#{@platform.name}" - bl.build_requires = false + bl.build_requires = false # already set as db default end end end diff --git a/db/migrate/20111130181101_change_build_lists_build_requires_default_value.rb b/db/migrate/20111130181101_change_build_lists_build_requires_default_value.rb new file mode 100644 index 000000000..fadc4e013 --- /dev/null +++ b/db/migrate/20111130181101_change_build_lists_build_requires_default_value.rb @@ -0,0 +1,9 @@ +class ChangeBuildListsBuildRequiresDefaultValue < ActiveRecord::Migration + def self.up + change_column_default :build_lists, :build_requires, false + end + + def self.down + change_column_default :build_lists, :build_requires, nil + end +end diff --git a/db/schema.rb b/db/schema.rb index 74e364bc6..17c70bd11 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111128140341) do +ActiveRecord::Schema.define(:version => 20111130181101) do create_table "arches", :force => true do |t| t.string "name", :null => false @@ -65,7 +65,7 @@ ActiveRecord::Schema.define(:version => 20111128140341) do t.boolean "is_circle", :default => false t.text "additional_repos" t.string "name" - t.boolean "build_requires" + t.boolean "build_requires", :default => false t.string "update_type" t.integer "bpl_id" t.integer "pl_id"