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.
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.
Sorry, I forgot to tell you that I want auto increment for a field other
than the primary key (id).
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs