Helen Poon wrote: > My problem is very similar. I want to use id as primary key. But the > default data type of integer is too small, I would like the id field to > be able to hold a Java long (ie BIGINT in mysql, sqlserver and DB2). > > There is no way that I can supply :limit to the id field? I tried to > use change_column after the table is created with id being the primary > key and that was unsuccessful (not allowed to change the column because > it is the primary key field). > > Any suggestions for me? > > Since my migration step will be applied to various databases (mysql, > sqlserver, db2, oracle), I don't have the option to run sql using > execute() because the sql can be different for these databases. > > Any help will be greatly appreciated!
Seems the belows works: 1. create the table without primary key 2. change_column <table_name>, <the_intended_primary_key_field>, <CHAR(10) PRIMARY KEY> -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.