Hi all, I''d like to know how can I set a field to auto increment in migrate scripts. In mysql, it''s auto_increment, and in postgresql, it''s serial. How can I make a migrate script which works in both places? TIA, Vamsee. -- Posted via http://www.ruby-forum.com/.
Sorry, I forgot to tell you that I want auto increment for a field other than the primary key (id). -- Posted via http://www.ruby-forum.com/.
Anthony DeRobertis
2006-Feb-28 16:47 UTC
[Rails] Re: Migrations - How to set auto increment?
Vamsee wrote:> Sorry, I forgot to tell you that I want auto increment for a field > other than the primary key (id). >mysql> create table test ( a int auto_increment primary key, b int unique auto_increment ); ERROR 1075: Incorrect table definition; There can only be one auto column and it must be defined as a key MySQL doesn''t seem able.