Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.06 KB

README.md

File metadata and controls

41 lines (31 loc) · 1.06 KB

Peegee

Peegee aims to bring better support for PostgreSQL to ActiveRecord. Peegee is under active development.

###Indexes

Peegee adds support for some indexing extensions allowed by Postgres. You can run these in your migrations.

Partial indexes

add_index :users, :column, :where => 'active = true'

Expression indexes

add_index :users, :name => 'users_created_at_date' do |i|
  i.expression 'DATE(created_at)'
end

Sorted indexes

add_index :users, :name => 'users_created_at_date' do |i|
  i.column :name, :asc
  i.column :active, :desc
end
add_index :users, :name, :name => 'users_name', :concurrently => true

Note that this cannot run inside of a transaction. This will commit your running transaction, add the index concurrently, and start a new transaction. Use with caution.

License

Peegee is distributed under the MIT license.

Copyright 2011 - Harold Giménez and Mike Burns