How to set auto increment by 1 on a table in your migration script
ALTER TABLE Table_name AUTO_INCREMENT = 1;
Is it possible to mention this during table creation or after that, in your DB migration scripts.
How to set auto increment by 1 on a table in your migration script
ALTER TABLE Table_name AUTO_INCREMENT = 1;
Is it possible to mention this during table creation or after that, in your DB migration scripts.
Maybe there are better solutions. Otherwise you can run raw SQL statements in migration scripts like this:
ActiveRecord::Base.connection.execute("ALTER TABLE Table_name AUTO_INCREMENT = 1")