On Nov 12, 2009, at 4:16 PM, Thomas Gendulphe wrote: > Rob Biedenharn wrote: >> On Nov 11, 2009, at 4:55 AM, Thomas Gendulphe wrote: >> >>> | Field | Type | Null | Key | Default | >>> | | >>> | user_id | int(11) | YES | MUL | NULL >>> t.datetime "created_at" >>> t.boolean "confirmed" >>> t.text "admin_comment" >>> t.datetime "confirmed_at" >>> t.integer "bet_id" >>> t.integer "user_id" >>> end >>> >>> Why the hell is the size limit lost? >>> -- >> >> What size limit is that? Did you mean to show the migration that >> created the table? Since MySQL has no boolean type, it gets >> implemented as tinyint(1) and the default for integer is int(11). Do >> you still thing that there is a problem? >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> [email protected] > > Actually, the source database, from which schema.rb is created has > columns, like user_id, with a type of integer(11). > In schema.rb, it is dumped as t.integer "user_id". > When I load the schema in another databse, it creates a column user_id > with a type of integer(4). > > So I am wondering why schema dump is not t.integer "user_id", :limit > => > 11 > --
Ah! Do those mean an equivalent thing? For example, is one database's "int(11)" a type to hold integers of up to 11 decimal digits and another database's "integer(4)" a type that holds integers in 4 bytes? Those are the same thing! And you probably wouldn't want to suddenly have 11 BYTE integers in the other (or 4 DIGIT integers in the first). -Rob (Notwithstanding Hassan's pointer to the meaning of MySQL's use of 11 to indicate the display width.) Rob Biedenharn http://agileconsultingllc.com [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

