bookstore/db/migrate/20210319142051_create_authors.rb
2021-03-22 04:38:35 +01:00

15 lines
286 B
Ruby

# frozen_string_literal: true
# Create authors
class CreateAuthors < ActiveRecord::Migration[6.1]
def change
create_table :authors do |t|
t.string :first_name
t.string :last_name
t.timestamps
end
add_index :authors, %i[first_name last_name]
end
end