Created
December 15, 2009 09:40
-
-
Save madx/256812 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class SplitLog < Sequel::Migration | |
def up | |
alter_table :comments do | |
add_foreign_key :entry_id, :entries | |
end | |
alter_table :entries do | |
drop_column :url | |
add_column :author, String | |
end | |
alter_table :issues do | |
rename_column :description, :body | |
end | |
end | |
def down | |
alter_table :comments do | |
drop_column :entry_id | |
end | |
alter_table :entries do | |
add_column :url, String | |
drop_column :author | |
end | |
alter_table :issues do | |
rename_column :body, :description | |
end | |
end | |
end |
This file contains hidden or 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
class AddForeignKeysToEvents < Sequel::Migration | |
def up | |
alter_table :events do | |
add_foreign_key :issue_id, :issues | |
add_foreign_key :entry_id, :entries | |
end | |
end | |
def down | |
alter_table :events do | |
drop_column :issue_id | |
drop_column :entry_id | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment