Skip to content

Instantly share code, notes, and snippets.

@procload
Created December 26, 2011 18:41
Show Gist options
  • Save procload/1521889 to your computer and use it in GitHub Desktop.
Save procload/1521889 to your computer and use it in GitHub Desktop.
class DropEventsTable < ActiveRecord::Migration
def up
create_table :meetups_planners, :id => false do |t|
t.references :meetup, :null => false
t.references :planner, :null => false
end
add_index(:meetups_planners, [:meetup_id, :planner_id], :unique => true)
end
def down
execute "ALTER TABLE events DROP FOREIGN KEY fk_products_categories"
drop_table :events
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment