jam-cloud/db
Steven Miers 614cfcbe85 Merge feature/calendaring branch:
commit 8023d6481c
    VRFS-3276 : Hook calendar creation into user controller API.  Add test to verify.

commit 3a35002a46
    VRFS-3276 : Calendar cleanup job

    * Add cleanup method to calendar manager
    * Create a daily job.
    * Add calendar cleanup to that job.
    * Add CRON entry
    * Daily job/ calendar cleanup test cases
    * Fix calendar manager spec for new required attribute

commit 3ff5910f1f
    VRFS-3276 : Add a delete-calendar directive when RSVP is canceled.
    VRFS-3276 : Include path to partial.  This fails depending on the method used to start the web server.

commit d2441cbf57
    VRFS-3276 : Test new calendar features. Use icalendar gem in test mode only to more deeply verify calendar in strict mode.

commit 9ac272a0fb
    VRFS-3276 : Calendar manager updates to include manual calendars.  Some refactoring to keep common stuff in one place.

commit b5d0c758f0
    VRFS-3276 : Schema, model updates and new calendar model.

commit 20472b6b26
    VRFS-3276 : Change initial submit behavior of RSVP dialog to display calendar info.  The user can then close the dialog after this prompt.

commit 77c99103d0
    VRFS-3276 : Calendar feed markup and styling.  Included as partial.

commit e632f48600
    VRFS-3276 : Routes and controller implementation of user calendar ICS feed, which uses calendar manager.

commit 21fd80a188
    VRFS-3276 : Initial tests for calendar manager

commit 92a2524c65
    VRFS-3276 : Calendar manager

    * Streamline logic
    * Enable recurring sessions through rrule
    * Implement method to create ics feed for user
    * Extract a type-safe scheduled duration method on music_session for
    external and internal use.

commit b71ad3a4cd
    VRFS-3276 : Include calendar manager

commit f8eaafd036
    VRFS-3276 : Calendar Manager - initial checkin

    * Create ICS events given individual parameters
    * Create calendar from music session
    * Also will create ICS “delete” events
2015-07-06 15:34:27 -05:00
..
up Merge feature/calendaring branch: 2015-07-06 15:34:27 -05:00
.gitignore merging jam-db into db 2013-09-15 17:58:54 +00:00
.pg_migrate merging jam-db into db 2013-09-15 17:58:54 +00:00
.ruby-gemset merging jam-db into db 2013-09-15 17:58:54 +00:00
.ruby-version fix warning related to ruby- prefix in .ruby-version files 2013-12-27 16:28:28 -05:00
Gemfile * pg_migrate bump to 0.1.13 with relaxed thor version 2014-02-18 03:42:42 +00:00
Gemfile.lock Merge feature/calendaring branch: 2015-07-06 15:34:27 -05:00
README.md merging jam-db into db 2013-09-15 17:58:54 +00:00
build * intsall to vendor/bundle 2014-02-02 14:03:31 -06:00
jenkins * VRFS-1016 2014-01-31 14:25:17 -06:00
manifest Merge feature/calendaring branch: 2015-07-06 15:34:27 -05:00

README.md

jam-db

Schema migrations for the jam-db database. Uses the pg_migrate tool tool. The github page of pg_migrate also has some documentation and rationale behind this approach of migrations.

Overview

am-db defines the migrations that comprise the jam-db database. It uses pg_migrate to package up the migrations into a gem or (TODO) jar. You can then use those packaged up versions of the schemas in downstream projects.

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.

Environment

  • rvm 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)
  • Definition of location for your developer workspace. Default is ~/workspace, but if you define an env variable, you can override.
  • pg_migrate_ruby - $ cd [workspace] && git clone https://github.com/sethcall/pg_migrate_ruby
  • The current logged in OS user has access to the 'postgres' database and is a super user in the database. In other words, you want to make sure your current logged in user can do the following at the command line: 'psql postgres'. If you can do that, you should be OK. There are two reasons this may not work for you.
  1. Your current user is not a superuser. If not, do sudo su postgres -c "createuser YOURUSER" and answer 'y' with the first question.
  2. If your user already is a superuser, then the postgres database may not exist yet. In that case, do psql then create database postgres
  • NOT YET: $IVY defined as path to the apache ivy jar. Download the latest ivy from here, extract somewhere, and create an IVY environment variable with a path to the ivy.jar. For example, in my bash.profile: export IVY=/Users/seth/workspace/apache-ivy-2.3.0-rc1/ivy-2.3.0-rc1.jar

Building

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 # this will clean your 'target' directory, and rebuild from scratch. It takes seconds.

Using

In a ruby project, create in your gemfile something like: ` https 'https://rubygems.org'

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 up --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;

If your database is screwed up, do this:

dropdb jam createdb jam migrate.sh

END