Permalink
Browse files

Added migration to drop snippet_page table.

  • Loading branch information...
1 parent a98c20e commit a25d18e7536565bd251b590e6329d7923bdc3820 @rochgs rochgs committed Aug 19, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 db/migrate/5_drop_snippet_page.rb
@@ -0,0 +1,20 @@
+class DropSnippetPage < ActiveRecord::Migration
+
+ def self.up
+ remove_index :snippet_page, :snippet_id
+ remove_index :snippet_page, :page_id
+ drop_table :snippet_page
+ end
+
+ def self.down
+ create_table :snippet_page do |t|
+ t.integer :snippet_id, :null => false, :references => [:snippets, :id]
+ t.integer :page_id, :null => false, :references => [:pages, :id]
+ t.integer :position, :null => false, :default => 0
+ end
+
+ add_index :snippet_page, :snippet_id
+ add_index :snippet_page, :page_id
+ end
+
+end

0 comments on commit a25d18e

Please sign in to comment.