You can create the table and index with the generator without changing the migration file
For a unique index
rails generate model CreateFoos bar:string:uniq
For a non-unique index
rails generate model CreateFoos bar:string:index
You can create the table and index with the generator without changing the migration file
For a unique index
rails generate model CreateFoos bar:string:uniq
For a non-unique index
rails generate model CreateFoos bar:string:index
rake db:test:load
recreates the test database from the current db/schema.rb
rake db:test:prepare
Check for pending migrations and,
load the test schema
https://blog.saeloun.com/2019/09/30/rails-6-adds-db-seed-replant-task-and-db-truncate_all.html
| { | |
| :duration => 2000.2723450306803, | |
| :allocations => 20, | |
| :cpu_time => 0.20638099999999854, | |
| :idle_time => 2000.0659640306803, | |
| :transaction_id => "054dc3152d419f050463", | |
| :payload => { | |
| :rack_env => { | |
| "CONTENT_LENGTH" => "7", | |
| "CONTENT_TYPE" => "application/protobuf", |
| { | |
| :duration => 0.21136004943400621, | |
| :allocations => 5, | |
| :cpu_time => 0.09248999999999889, | |
| :idle_time => 0.11887004943400732, | |
| :transaction_id => "054dc3152d419f050463", | |
| :payload => { | |
| :rack_env => { | |
| "CONTENT_LENGTH" => "7", | |
| "CONTENT_TYPE" => "application/protobuf", |
| { | |
| "TerminalKey": "TinkoffBankTest", | |
| "PaymentId": 2304882, | |
| "Token": "c0ad1dfc4e94ed44715c5ed0e84f8ec439695b9ac219a7a19555a075a3c3ed24", | |
| "IP": "192.168.255.255", | |
| "Amount": 19200, | |
| "Receipt": { | |
| "FfdVersion": "string", | |
| "ClientInfo": { | |
| "Birthdate": "string", |
| ru: | |
| activemodel: | |
| errors: | |
| models: | |
| payments/tinkoff/cancel: | |
| attributes: | |
| base: | |
| failure: "Ошибка #%{interaction_id} %{details}" | |
| payments/tinkoff/init: | |
| attributes: |