Rails 4 errors on simple migration on Postgres -
The first rail 4 migration bug Postgrejh I have found that it is really a bug.
I do not understand that it will not be very simple migration why it works:
class AddAdminToUsers & lt; Administrators :: Users: ActiveRecord :: Migration Def Add_column Changes Boolean, {Default: false, null: false} end-end
I have tried it with and without curly braces. Here's the error:
== AddAdminToUsers: Migrating ================================= ======================= - add_column (: user ,: administrator ,: boolean, {: default => false ,: null => false}) rack Rejected! An error has occurred, this and all subsequent migration canceled:
Wrong number of arguments (for 2 1) /Users/me/.rvm/gems/ruby-2.0. 0-p353 @ myapp /gems/rails_best_practices-1.15.0/lib/rails_best_practices/core_ext/object.rb:7:in 'try' /Users/me/.rvm/gems/ruby-2.0.0-p353@myapp/ Gems / activerecord-4.0 .2 / lib / active_record / connection_adapters / postgresql_adapter.rb: 723: `in translate_exception '/Users/me/.rvm/gems/ruby-2.0.0-p353@myapp/gems/activerecord-4.0. 2 / lib / active_record log in `rescue '/connection_adapters/abstract_adapter.rb:439:in/Users/me/.rvm/gems/ruby-2.0.0-p353@myapp/gems/activerecord-4.0.2/lib/ Active_record / connection_adapters/abstract_adapter .rb: 435: `Logon in '/Users/me/.rvm/gems/ruby-2.0.0-p353@myapp/gems/activerecord-4.0.2/lib/active_record/connection_adapters /postgresql/database_statements.rb:127: In `Execute '
it is very clear that it is allowed:
add_column (table_name, column_name, type , Options): Adds a new column to the table C to be one of the following table, designated column_name named all the table_name :: string,: text,: integer, float, decimal: data time, timestamp, time : Date, binary ,: boolean is a default value can be specified by passing an options hash {default: 11}. Other options: limit and zero (eg {border: 50, zero false})
Also, why railway best practices
gem complaint Still working ? I am not implementing it.
this rails_best_practices
gem when I uninstall that gem, code I will inform the gem guardian that works.
Comments
Post a Comment