From 1a386d0563a875c1fb431dd4056841fb65eaf43a Mon Sep 17 00:00:00 2001 From: Dmitri Garbuzov Date: Thu, 22 Jul 2010 18:53:35 -0400 Subject: [PATCH] Removed unused attributes from question and prompt --- db/migrate/20100722050746_remove_unused_question_attributes.rb | 15 +++++++++++++++ db/migrate/20100722052215_remove_unused_prompt_attributes.rb | 15 +++++++++++++++ db/schema.rb | 10 +--------- 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 db/migrate/20100722050746_remove_unused_question_attributes.rb create mode 100644 db/migrate/20100722052215_remove_unused_prompt_attributes.rb diff --git a/db/migrate/20100722050746_remove_unused_question_attributes.rb b/db/migrate/20100722050746_remove_unused_question_attributes.rb new file mode 100644 index 0000000..3e2d285 --- /dev/null +++ b/db/migrate/20100722050746_remove_unused_question_attributes.rb @@ -0,0 +1,15 @@ +class RemoveUnusedQuestionAttributes < ActiveRecord::Migration + def self.up + remove_column :questions, :active_items_count + remove_column :questions, :bloom + remove_column :questions, :first_prompt_algorithm_id + remove_column :questions, :items_count + end + + def self.down + add_column :questions, :active_items_count, :integer, :default => 0 + add_column :questions, :bloom, :text + add_column :questions, :first_prompt_algorithm_id, :integer + add_column :questions, :items_count, :integer, :default => 0 + end +end diff --git a/db/migrate/20100722052215_remove_unused_prompt_attributes.rb b/db/migrate/20100722052215_remove_unused_prompt_attributes.rb new file mode 100644 index 0000000..e42a3fd --- /dev/null +++ b/db/migrate/20100722052215_remove_unused_prompt_attributes.rb @@ -0,0 +1,15 @@ +class RemoveUnusedPromptAttributes < ActiveRecord::Migration + def self.up + remove_column :prompts, :active + remove_column :prompts, :algorithm_id + remove_column :prompts, :randomkey + remove_column :prompts, :voter_id + end + + def self.down + add_column :prompts, :active, :boolean + add_column :prompts, :algorithm_id, :integer + add_column :prompts, :randomkey, :integer + add_column :prompts, :voter_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index b933107..5bd25fa 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20100719030739) do +ActiveRecord::Schema.define(:version => 20100722052215) do create_table "appearances", :force => true do |t| t.integer "voter_id" @@ -127,17 +127,13 @@ ActiveRecord::Schema.define(:version => 20100719030739) do end create_table "prompts", :force => true do |t| - t.integer "algorithm_id" t.integer "question_id" t.integer "left_choice_id" t.integer "right_choice_id" - t.integer "voter_id" - t.boolean "active" t.datetime "created_at" t.datetime "updated_at" t.text "tracking" t.integer "votes_count", :default => 0 - t.integer "randomkey" end add_index "prompts", ["left_choice_id", "right_choice_id", "question_id"], :name => "a_cool_index", :unique => true @@ -150,18 +146,14 @@ ActiveRecord::Schema.define(:version => 20100719030739) do t.string "name", :default => "" t.datetime "created_at" t.datetime "updated_at" - t.integer "items_count", :default => 0 - t.integer "active_items_count", :default => 0 t.integer "choices_count", :default => 0 t.integer "prompts_count", :default => 0 t.boolean "active", :default => false t.text "tracking" - t.integer "first_prompt_algorithm_id" t.text "information" t.integer "site_id" t.string "local_identifier" t.integer "votes_count", :default => 0 - t.text "bloom" t.boolean "it_should_autoactivate_ideas", :default => false t.integer "inactive_choices_count", :default => 0 t.boolean "uses_catchup", :default => true -- libgit2 0.21.2