db/migrate/20171227114338_create_orders.rb (8 lines of code) (raw):

class CreateOrders < ActiveRecord::Migration[5.1] def change create_table :orders do |t| t.belongs_to :customer, index: true, foreign_key: true, null: false t.timestamps end end end