spejman / simplified_fk
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
MIT-LICENSE | ||
| |
README | ||
| |
Rakefile | ||
| |
generators/ | ||
| |
init.rb | ||
| |
lib/ | ||
| |
test/ |
README
Simplified Fk
=============
Because adding foreign keys to your database should be easy.
Adding a foreign key:
add_foreign_key :from_table, :from_column, :to_table
Removing a foreign key:
remove_foreign_key :from_table, :from_column
**Note:** Only works on MySQL and PostgreSQL.
TODO
====
[ ] Add a task to suggest foreign keys.
Example
=======
class AddForeignKeyOnArticles < ActiveRecord::Migration
def self.up
add_foreign_key :articles, :user_id, :users
end
def self.down
remove_foreign_key :articles, :user_id
end
end
Copyright (c) 2008 Francesc Esplugas Marti, released under the MIT license
