Skip to content
Add foreign keys to your database. Only for PostgreSQL & MySQL.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
generators/simplified_fk
lib
test
.gitignore
MIT-LICENSE
README
Rakefile
init.rb

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
Something went wrong with that request. Please try again.