This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu Sep 18 12:00:57 -0700 2008 | |
| |
Manifest | Sat Sep 20 10:39:55 -0700 2008 | |
| |
README.mkdn | Sat Sep 20 15:29:37 -0700 2008 | |
| |
Rakefile | Fri Sep 19 07:06:36 -0700 2008 | |
| |
config/ | Sat Sep 20 08:44:02 -0700 2008 | |
| |
postgresql_migrations.gemspec | Sat Sep 20 10:42:51 -0700 2008 | |
| |
postgresql_migrations.rb | Sat Sep 20 08:44:02 -0700 2008 | |
| |
test/ | Sat Sep 20 08:44:02 -0700 2008 |
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







