rating/spec/support/db/migrate/create_reviews_table.rb

16 lines
458 B
Ruby
Raw Normal View History

2018-02-08 15:29:20 +00:00
# frozen_string_literal: true
class CreateReviewsTable < ActiveRecord::Migration[7.0]
2018-02-08 15:29:20 +00:00
def change
create_table :reviews do |t|
t.decimal :value, default: 0, precision: 25, scale: 16
t.references :author, index: true, null: false, polymorphic: true
t.references :resource, index: true, null: false, polymorphic: true
2018-02-08 19:15:52 +00:00
t.references :scopeable, index: true, null: true, polymorphic: true
2018-02-08 15:29:20 +00:00
2022-05-18 02:50:53 +00:00
t.timestamps
2018-02-08 15:29:20 +00:00
end
end
end