📜  rails start id to 1000 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:47.282000             🧑  作者: Mango

代码示例1
create_table :orders do |t|
  t.integer  :price
  # other stuff
end

# for Postgres
execute "SELECT setval('orders_id_seq', 1000)"

# and for mysql ...
execute "ALTER TABLE products AUTO_INCREMENT = 1000"