* beefing up readme some

This commit is contained in:
Seth Call 2012-07-29 13:56:09 -05:00
parent 275f36d122
commit e9ceb343ac
1 changed files with 20 additions and 8 deletions

28
README
View File

@ -1,13 +1,15 @@
jam-db jam-db
====== ======
Schema migrations for the jam-db database Schema migrations for the jam-db database. Uses the [pg_migrate tool](https://github.com/sethcall/pg_migrate) tool. The github page of pg_migrate also has some documentation and rationale behind this approach of migrations.
Overview Overview
-------- --------
jam-db defines the migrations that comprise the jam-db database. jam-db defines the migrations that comprise the jam-db database. It uses pg_migrate to package up the migrations iinto a gem or (TODO) jar. You can then use those packaged up versions of the schemas in downstream projects.
Environment The main reason the 'pg_migrate' approach is taken is to make to possible to use the database like an interface, freed from any one project or language.
Environmenti
----------- -----------
* [rvm](https://rvm.io/) with ruby 1.9.3 installed and activated. rvm needs to be activated in your shell (the installation process does this) * [rvm](https://rvm.io/) with ruby 1.9.3 installed and activated. rvm needs to be activated in your shell (the installation process does this)
* bash . If on windows, use git bash or cygwin. Bash is used as the build script technology. (could change very easily) * bash . If on windows, use git bash or cygwin. Bash is used as the build script technology. (could change very easily)
@ -15,8 +17,9 @@ Environment
Building Building
-------- --------
# one-time: ff you just installed rvm, cd into this project's base directory. rvm will ask you to trust the .rvmrc. Do so. # one-time: if you just installed rvm, cd into this project's base directory. rvm will ask you to trust the .rvmrc. Do so.
# type ./build # type:
./build # this will clean your 'target' directory, and rebuild from scratch. It takes seconds.
Using Using
----- -----
@ -27,9 +30,18 @@ https 'https://rubygems.org'
gem 'jam_db', :path => '~/workspace/jam-db/target/ruby_package' gem 'jam_db', :path => '~/workspace/jam-db/target/ruby_package'
` `
Then, to cause a migration, do something like:
# make sure you have the jam_db gem
bundle install
# migrate the database (assumes you've created the 'jam' database already).
bundle exec jam_db --connopts="dbname:jam host:localhost user:postgres password:postgres" --verbose
# you can see if it worked by typing:
psql jam
> select * from pgmigrate.pg_migrate;