PigRider Blogs

Sign In
HTML CSS Javascript Ruby on Rails C++ Java Python SQL Git Linux Others All

MySql: add auto-increment feature to a column in Ruby on Rails

[Author: ming.lian]   [Sun, 2013-08-11, 17:47]   [3814 views]

Ruby on Rails SQL

In ruby on rails, if you need to set a column with auto-increment, you have to execute a SQL command in your model.
Alter table Tablename modify column ColumnName int(11) auto_increment;