2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/rails/generators/merry_go_round/install/templates/add_aggregations.rb', line 2
def change
create_table :merry_go_round_aggregations do |t|
t.string :key, null: false
t.integer :value, null: false, default: 0
t.datetime :timestamp, null: false
t.string :granularity, null: false
t.integer :parent_id
end
add_index :merry_go_round_aggregations, [:granularity, :timestamp, :key, :parent_id], name: 'merry_go_round_aggregations_kgtp'
add_index :merry_go_round_aggregations, [:parent_id, :granularity, :timestamp], name: 'merry_go_round_aggregations_pgt'
end
|