Mysql 设置/更改Rails id自动增量值
我有没有办法在Rails中设置id的增量值?不是+1,而是+10(或我指定的其他函数)Mysql 设置/更改Rails id自动增量值,mysql,ruby-on-rails,postgresql,rails-postgresql,Mysql,Ruby On Rails,Postgresql,Rails Postgresql,我有没有办法在Rails中设置id的增量值?不是+1,而是+10(或我指定的其他函数) 在MySQL中有一个选项@@auto\u increment\u increment。有没有办法通过ActiveRecord在Rails中进行设置?我正在与两位Postgre合作。查看Rails 3.x迁移指南: 有一个例子,他们硬编码一些sql class SomeMigration < ActiveRecord::Migration def up execute <<
在MySQL中有一个选项@@auto\u increment\u increment。有没有办法通过ActiveRecord在Rails中进行设置?我正在与两位Postgre合作。查看Rails 3.x迁移指南: 有一个例子,他们硬编码一些sql
class SomeMigration < ActiveRecord::Migration
def up
execute <<-SQL
ALTER TABLE xxx
SQL
end
end
classsomemigration 执行检查Rails 3.x迁移指南:
有一个例子,他们硬编码一些sql
class SomeMigration < ActiveRecord::Migration
def up
execute <<-SQL
ALTER TABLE xxx
SQL
end
end
classsomemigration