Permalink
Browse files

make migrations actually work, renumber and fix

  • Loading branch information...
1 parent 372b7c2 commit 823ac1e6b577d0360ddff24d07bec876aef5e9fe James Cox committed Apr 2, 2008
File renamed without changes.
@@ -0,0 +1,14 @@
+class CreateLinks < ActiveRecord::Migration
+ def self.up
+ create_table :links do |t|
+ t.integer :from_page_id
+ t.integer :to_page_id
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :links
+ end
+end
@@ -0,0 +1,12 @@
+class PageSiteFk < ActiveRecord::Migration
+ def self.up
+ add_column :pages, :site_id, :integer
+ add_column :page_versions, :site_id, :integer
+ Page.update_all 'site_id=1'
+ end
+
+ def self.down
+ remove_column :pages, :site_id
+ remove_column :page_versions, :site_id
+ end
+end
@@ -0,0 +1,9 @@
+class AddLockingToPages < ActiveRecord::Migration
+ def self.up
+ add_column :pages, :locked_at, :datetime
+ end
+
+ def self.down
+ remove_column :pages, :locked_at
+ end
+end

0 comments on commit 823ac1e

Please sign in to comment.