Skip to content

Instantly share code, notes, and snippets.

@gerhard
Created October 29, 2008 16:05
Show Gist options
  • Save gerhard/20728 to your computer and use it in GitHub Desktop.
Save gerhard/20728 to your computer and use it in GitHub Desktop.
class CreateRouteFilters < ActiveRecord::Migration
def self.up
create_table :route_filters do |t|
t.column :site_id, :integer, :null => :true
t.column :internal_path, :string
t.column :external_path, :string
t.column :external_domain, :string
end
add_index(:route_filters, :internal_path)
add_index(:route_filters, :external_path)
add_index(:route_filters, :external_domain)
end
def self.down
remove_index(:route_filters, :internal_path)
remove_index(:route_filters, :external_path)
remove_index(:route_filters, :external_domain)
drop_table :route_filters
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment