プログラマの会話1

■なんで、migrationのadd_columnでは:smallintが使えないのか。
(table_create時には使える)
と、IRCで会話してみた。


15:02 (yut) あーわかった
15:02 (na) mjsk
15:02 (fuk) def native_database_types #:nodoc:
15:02 (fuk) {
15:02 (fuk) :primary_key => "int(11) DEFAULT NULL auto_increment
PRIMARY KEY",
15:02 (fuk) :string => { :name => "varchar", :limit =>
255 },
15:02 (fuk) :text => { :name => "text" },
15:02 (fuk) :integer => { :name => "int", :limit => 11 },
15:02 (fuk) :float => { :name => "float" },
15:02 (fuk) :decimal => { :name => "decimal" },
15:02 (fuk) :datetime => { :name => "datetime" },
15:02 (fuk) :timestamp => { :name => "datetime" },
15:02 (yut) http://dev.live-revolution.co.jp:3333/builds/rixi/2292
15:02 (hamme) CruiseControl.rb
15:02 (fuk) :time => { :name => "time" },
15:03 (fuk) :date => { :name => "date" },
15:03 (fuk) :binary => { :name => "blob" },
15:03 (fuk) :boolean => { :name => "tinyint", :limit => 1 }
15:03 (fuk) }
15:03 (yut) >The error occurred while evaluating nil.[]
15:03 (hamme) 日本語でおk
15:03 (fuk) end
15:03 (fuk) これだ
15:03 (yut) で
15:03 (yut)
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
15:04 (yut) L265
15:04 (yut) column_type はnil なので
15:04 (yut) nil<< して例外
15:04 (yut) s/column_type/column_type_sql/
15:05 (na) hontoda
15:05 (na) なるほど〜
15:05 (yut) テーブルつくるときはadd_column じゃなくてなにつかってるんだろ
15:06 (na) 別のものをつかっているってことですよね
15:06 (yut) tabun
15:06 (yut) あ、
15:06 (yut) add_column はALTER つかってたからべつですね
15:08 (yut) a-
15:08 (yut)
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
15:08 (hamme) nopaste:
http://dev.live-revolution.co.jp/nopaste/3c365641699200b3e1c6c0f1c6310b3d.html
15:09 (yut) native_database_type 見てない
15:09 (na) なんでこっちはみないんだろう
15:09 (yut) なんですかねえ
15:09 (na) 不思議
15:09 (yut) 非対称ですね
15:10 (na) 確かに。
15:10 (na) というか、早いっすね
15:10 (na) yuta++ migrateとsmallintの疑問解決
15:10 (hamme) yuta ++'ed by nag (migrateとsmallintの疑問解決)
http://11.dev.live-revolution.co.jp/evaluations/show/1550
15:11 (fuk) migrate そのままか・・・
15:11 (yut) trunk みてみよう
15:11 (na) やっぱりコードリーディングは面白いなぁ
15:12 (yut) ですねえ
15:12 (yut) trunk も変更なしだった
15:12 (yut)
http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L90
15:12 (hamme)
/trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
- Rails Trac - Trac


やっぱ、できる人ってコード読む癖があるね★