I\'m writing a migration to convert a non-rails app into the right format for rails - one of the tables for some reason does not have auto increment set on the id column. I
The Postgres answer by @jlfenaux misses out on the serial type, which does all of it for you automatically:
ALTER TABLE tbl add tbl_id serial;
More details in this related answer.