class CreateSuppliers < ActiveRecord::Migration[5.0] def change create_table :suppliers do |t| t.string :name t.timestamps end create_table :accounts do |t| t.belongs_to :supplier, index: true t.string :account_number t.timestamps end end end [2] pry(main)> Supplier.create(name: 'dan') (0.1ms) BEGIN SQL (27.8ms) INSERT INTO "suppliers" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETUR