Class: CreateGfreshPointRule

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/gfresh_point/install/templates/create_gfresh_point_rule.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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