Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make migrations actually work, renumber and fix
- Loading branch information
James Cox
committed
Apr 2, 2008
1 parent
372b7c2
commit 823ac1e
Showing
6 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |