Skip to content

Commit

Permalink
make migrations actually work, renumber and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cox committed Apr 2, 2008
1 parent 372b7c2 commit 823ac1e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
File renamed without changes.
14 changes: 14 additions & 0 deletions db/migrate/013_create_links.rb
@@ -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
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions db/migrate/015_page_site_fk.rb
@@ -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
9 changes: 9 additions & 0 deletions db/migrate/016_add_locking_to_pages.rb
@@ -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.