class CreateGfreshPointRule

Public Instance Methods

change() click to toggle source
# File lib/generators/gfresh_point/install/templates/create_gfresh_point_rule.rb, line 2
def change
  create_table :gfresh_point_rules do |t|
    t.string  :app_id
    t.string  :event_name
    t.integer :point
    t.string  :name

    t.timestamps
  end
  add_index :gfresh_point_rules, [:app_id, :event_name], unique: true

  create_table :gfresh_point_balances do |t|
    t.string  :app_id
    t.string  :user_id
    t.integer :point
    t.integer :balance
    t.string  :event_name
    t.string  :origin_id
    t.datetime :read_at
    t.json  :comment
    t.timestamps
  end
  add_index :gfresh_point_balances, :app_id
  add_index :gfresh_point_balances, :user_id
end