This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IndexUsersEmails < ActiveRecord::Migration | |
def self.up | |
execute "END" | |
add_pg_index :users, :email, :lock => false | |
execute "BEGIN" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# vim: set syntax=ruby | |
# Ensures that changes to the Rails schema.rb file may only be committed if a | |
# migration file is also committed at the same time. | |
# put this in .git/hooks/pre-commit | |
def schema_modified? | |
%x[ git diff --cached |grep schema.rb ] == '' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attachments: parent_id, asset_id | |
domain_names: organisation_id | |
event_memberships: user_id, event_id | |
events: editor_id | |
group_actions: user_id, group_id | |
groups: user_id | |
icons: parent_id | |
invitations: sender_id | |
legacy_actions: item_upon_id | |
news_items: author_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_index :attachments, :parent_id | |
add_index :attachments, :asset_id | |
add_index :domain_names, :user_id | |
add_index :domain_names, :event_id | |
add_index :event_memberships, :user_id | |
add_index :event_memberships, :event_id |