From 964b4493f8db742f4d0b5f79b761fd2ced3cf9fc Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 17 Jun 2015 14:30:05 -0700 Subject: [PATCH] Add indexes for timestamp to stats --- migrations/069_add_stat_created_indexes.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrations/069_add_stat_created_indexes.rb diff --git a/migrations/069_add_stat_created_indexes.rb b/migrations/069_add_stat_created_indexes.rb new file mode 100644 index 00000000..bc5a6741 --- /dev/null +++ b/migrations/069_add_stat_created_indexes.rb @@ -0,0 +1,13 @@ +Sequel.migration do + up { + %i{stat_referrers stat_locations stat_paths} do |t| + DB.add_index t, :created_at + end + } + + down { + %i{stat_referrers stat_locations stat_paths} do |t| + DB.drop_index t, :created_at + end + } +end