2018-02-08 15:29:20 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-05-18 01:38:26 +00:00
|
|
|
class CreateReviewRatingsTable < ActiveRecord::Migration[7.0]
|
2018-02-08 15:29:20 +00:00
|
|
|
def change
|
|
|
|
create_table :review_ratings do |t|
|
|
|
|
t.decimal :average, default: 0, mull: false, precision: 25, scale: 16
|
|
|
|
t.decimal :estimate, default: 0, mull: false, precision: 25, scale: 16
|
2022-05-18 02:50:42 +00:00
|
|
|
t.bigint :sum, default: 0, mull: false
|
|
|
|
t.bigint :total, default: 0, mull: false
|
2018-02-08 15:29:20 +00:00
|
|
|
|
|
|
|
t.references :resource, index: true, null: false, polymorphic: true
|
|
|
|
t.references :scopeable, index: true, null: true, polymorphic: true
|
|
|
|
|
|
|
|
t.timestamps null: false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|