Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update with changes to generated migration scripts, move data populat…
…ion to db/seeds.b
- Loading branch information
Eric Hansen
committed
Aug 5, 2010
1 parent
1eb3df2
commit 95c6612
Showing
13 changed files
with
119 additions
and
50 deletions.
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
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
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
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
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
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
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
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
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
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
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,21 @@ | ||
class FluxxCrmCreateRoleUsers < ActiveRecord::Migration | ||
def self.up | ||
create_table :role_users do |t| | ||
t.timestamps | ||
t.integer :created_by_id, :updated_by_id, :null => true, :limit => 12 | ||
t.string :name, :null => false | ||
t.integer :user_id, :null => true, :limit => 12 | ||
t.string :roleable_type, :null => true | ||
t.integer :roleable_id, :null => true, :limit => 12 | ||
end | ||
add_index :role_users, [:name, :roleable_type, :roleable_id] | ||
add_index :role_users, :user_id | ||
execute "alter table role_users add constraint role_users_created_by_id foreign key (created_by_id) references users(id)" unless connection.adapter_name =~ /SQLite/i | ||
execute "alter table role_users add constraint role_users_updated_by_id foreign key (updated_by_id) references users(id)" unless connection.adapter_name =~ /SQLite/i | ||
execute "alter table role_users add constraint role_users_user_id foreign key (user_id) references users(id)" unless connection.adapter_name =~ /SQLite/i | ||
end | ||
|
||
def self.down | ||
drop_table :role_users | ||
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
Oops, something went wrong.