rails start id to 1000
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"
rails start id to 1000
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"
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us