Instantly share code, notes, and snippets.
Created
August 26, 2011 15:45
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save stephenprater/1173710 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeMenuCategoryToBoolean < ActiveRecord::Migration | |
def self.up | |
change_column :categories, :menu_category, :boolean, :default => false | |
end | |
def self.down | |
change_column :categories, :menu_category, :integer | |
end | |
end | |
** Invoke db:migrate (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:migrate | |
== ChangeMenuCategoryToBoolean: migrating ==================================== | |
-- change_column(:categories, :menu_category, :boolean, {:default=>false}) | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
undefined method `to_sym' for nil:NilClass | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/whiny_nil.rb:48:in `method_missing' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/schema_definitions.rb:487:in `column' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:325:in `block (2 levels) in copy_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:319:in `each' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:319:in `block in copy_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/schema_statements.rb:157:in `create_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:317:in `copy_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:311:in `move_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:304:in `block in alter_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:303:in `alter_table' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/sqlite_adapter.rb:260:in `change_column' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:383:in `block in method_missing' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:359:in `block in say_with_time' | |
/opt/local/lib/ruby1.9/1.9.1/benchmark.rb:294:in `measure' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:359:in `say_with_time' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:379:in `method_missing' | |
/Users/stephenprater/Sites/agrport/db/migrate/20110825210251_change_menu_category_to_boolean.rb:3:in `up' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:312:in `block in migrate' | |
/opt/local/lib/ruby1.9/1.9.1/benchmark.rb:294:in `measure' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:312:in `migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:395:in `migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:537:in `block (2 levels) in migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:611:in `call' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:611:in `block in ddl_transaction' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/transactions.rb:207:in `transaction' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:611:in `ddl_transaction' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:536:in `block in migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:523:in `each' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:523:in `migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:433:in `up' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/migration.rb:415:in `migrate' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' | |
/opt/local/lib/ruby1.9/1.9.1/monitor.rb:201:in `mon_synchronize' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>' | |
/opt/local/bin/rake:19:in `load' | |
/opt/local/bin/rake:19:in `<main>' | |
Tasks: TOP => db:migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment