A plugin to easily add constraints into a PostgreSQL database.  I think
it would be easy to add other database engines to it assuming they
implement constraints.

The GIT repository is here:

http://github.com/pedz/activerecord_constraints

The rdoc is here:

http://pedz.github.com/activerecord_constraints

A small snippet from the readme:

Unique Constraint:

    class CreateFoos < ActiveRecord::Migration
      def self.up
        create_table :foos do |t|
          # name will have a "unique" constraint
          t.string :name, :null => false, :unique => true
        end
      end
    end

Trivial foreign key constraint:

    class CreateFoos < ActiveRecord::Migration
      def self.up
        create_table :foos do |t|
          # bar_id will now be a foreign key constraint column id in
table bar
          t.integer :bar_id, :null => false, :reference => true
        end
      end
    end
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to