Skip to content

Instantly share code, notes, and snippets.

@mberman84
Created January 16, 2015 04:33
Show Gist options
  • Select an option

  • Save mberman84/4869b030d931f3baf62b to your computer and use it in GitHub Desktop.

Select an option

Save mberman84/4869b030d931f3baf62b to your computer and use it in GitHub Desktop.
class AddCreatedAtIndexOnMessage < ActiveRecord::Migration
def up
execute "CREATE INDEX index_messages_on_day ON messages USING btree (DATE(created_at AT TIME ZONE '-08:00'));"
end
def down
execute "DROP INDEX index_messages_on_day;"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment