bookstore/db/migrate/20210319142054_create_books.rb

17 lines
308 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 books
2021-03-19 17:31:38 +02:00
class CreateBooks < ActiveRecord::Migration[6.1]
def change
create_table :books do |t|
t.string :title
t.decimal :price, precision: 10, scale: 2
t.boolean :published
t.timestamps
end
add_index :books, :published
end
end