Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run the migration generator to see the effect on the app: $ hobo generate migration
- Loading branch information
1 parent
6bc889d
commit 561235c
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class ProjectOwnership < ActiveRecord::Migration | ||
def self.up | ||
add_column :projects, :owner_id, :integer | ||
|
||
add_index :projects, [:owner_id] | ||
end | ||
|
||
def self.down | ||
remove_column :projects, :owner_id | ||
|
||
remove_index :projects, :name => :index_projects_on_owner_id rescue ActiveRecord::StatementInvalid | ||
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