public
Fork of fesplugas/simplified_fk
Description: Add foreign keys to your database. Only for PostgreSQL & MySQL.
Clone URL: git://github.com/spejman/simplified_fk.git
name age message
file .gitignore Tue May 27 13:40:34 -0700 2008 * first aproach to suggest fks generator [spejman]
file MIT-LICENSE Sun May 25 02:55:25 -0700 2008 Finally adding fk is easy ... [fesplugas]
file README Sun May 25 02:55:25 -0700 2008 Finally adding fk is easy ... [fesplugas]
file Rakefile Sun May 25 02:55:25 -0700 2008 Finally adding fk is easy ... [fesplugas]
directory generators/ Wed May 28 05:42:08 -0700 2008 * fix generator name [spejman]
file init.rb Mon May 26 13:41:23 -0700 2008 Refactored [fesplugas]
directory lib/ Tue May 27 13:40:34 -0700 2008 * first aproach to suggest fks generator [spejman]
directory test/ Sun May 25 02:55:25 -0700 2008 Finally adding fk is easy ... [fesplugas]
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