bookstore/db/migrate/20210319142051_create_authors.rb

16 lines
286 B
Ruby
Raw Permalink Normal View History

2021-03-22 03:16:29 +01:00
# frozen_string_literal: true
2021-03-22 04:38:35 +01:00
# Create authors
2021-03-19 17:31:38 +02:00
class CreateAuthors < ActiveRecord::Migration[6.1]
def change
create_table :authors do |t|
t.string :first_name
t.string :last_name
t.timestamps
end
2021-03-22 03:16:29 +01:00
add_index :authors, %i[first_name last_name]
2021-03-19 17:31:38 +02:00
end
end