public
Description: This gem implements add_foreign_key and remove_foreign_key for PostgreSQLAdapter.
Homepage: http://rafael.adm.br/opensource/postgresql_migrations
Clone URL: git://github.com/rafaelp/postgresql_migrations.git
name age message
file MIT-LICENSE Thu Sep 18 12:00:57 -0700 2008 first commit [rafaelp]
file Manifest Sat Sep 20 10:39:55 -0700 2008 Adding Manifest [rafaelp]
file README.mkdn Sat Sep 20 15:29:37 -0700 2008 Correcting example on README [rafaelp]
file Rakefile Fri Sep 19 07:06:36 -0700 2008 Changing Rakefile to the default one [rafaelp]
directory config/ Sat Sep 20 08:44:02 -0700 2008 Adding dependency of pg instead of postgres gem... [rafaelp]
file postgresql_migrations.gemspec Sat Sep 20 10:42:51 -0700 2008 Correcting gemspec [rafaelp]
file postgresql_migrations.rb Sat Sep 20 08:44:02 -0700 2008 Adding dependency of pg instead of postgres gem... [rafaelp]
directory test/ Sat Sep 20 08:44:02 -0700 2008 Adding dependency of pg instead of postgres gem... [rafaelp]
README.mkdn

Postgresql Migrations

DESCRIPTION

This gem implements "add_foreign_key" and "remove_foreign_key" for PostgreSQLAdapter.

REQUIREMENTS

  • activerecord
  • postgres

INSTALLATION

$ sudo gem sources -a http://gems.github.com (you only have to do this once)
$ sudo gem install rafaelp-postgresql_migrations

USAGE

Example 1

require 'postgresql_migrations'
class UserBelongsToAccount < ActiveRecord::Migration
  def self.up
    add_foreign_key :users, :account_id, :accounts, :id
  end

  def self.down
    remove_foreign_key :users, :account_id
  end
end

Example 2

require 'postgresql_migrations'
class UserBelongsToAccount < ActiveRecord::Migration
  def self.up
    add_foreign_key :users, :account_id, :accounts, :id, :match => 'simple', :on_delete => 'restrict', :on_update => 'cascade'
  end

  def self.down
    remove_foreign_key :users, :account_id
  end
end

LICENSE

Postgresql Migrations is released under the MIT License.

AUTHOR

Rafael Lima

Working at Myfreecomm

Blog: http://rafael.adm.br

Podcast: http://rafael.adm.br/voltandopracasa

Github: http://github.com/rafaelp

Twitter: http://twitter.com/rafaelp

Did you like?

Recommend me at Working With Rails