From 944a4830c1323aeb43425773d7706e611fa8f192 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Jul 2012 10:09:49 -0500 Subject: [PATCH 001/142] * adding README --- README | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 000000000..f44ddd1f8 --- /dev/null +++ b/README @@ -0,0 +1,21 @@ +jam-db +====== + +Schema migrations for the jam-db database + +Overview +-------- +jam-db defines the migrations that comprise the jam-db database. + +Environment +----------- +* [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) +* $IVY defined as path to the [apache ivy jar](http://ant.apache.org/ivy/download.cgi). 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` + + + + + + + From 4883389910605df121e34de8b422803a9ce6692c Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Jul 2012 12:36:02 -0500 Subject: [PATCH 002/142] * jam-db building ruby gem containing migrations and tool --- .gitignore | 2 ++ .rvmrc | 1 + Gemfile | 3 +++ build | 32 ++++++++++++++++++++++++++++++++ manifest | 0 up/.gitkeep | 0 6 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 .rvmrc create mode 100644 Gemfile create mode 100755 build create mode 100644 manifest create mode 100644 up/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..d913617bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target + diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 000000000..af54c123e --- /dev/null +++ b/.rvmrc @@ -0,0 +1 @@ +rvm use ruby-1.9.3-p194@jam-db --create diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..9ab53af3e --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'pg_migrate', :path=> '~/workspace/pg_migrate_ruby' diff --git a/build b/build new file mode 100755 index 000000000..301096623 --- /dev/null +++ b/build @@ -0,0 +1,32 @@ +#!/bin/bash + +TARGET=target +PG_BUILD_OUT=$TARGET/build +PG_RUBY_PACKAGE_OUT=$TARGET/ruby_package +PROJECT_NAME="jam_db" + +if [ -z $BUILD_NUMBER ]; then + BUILD_NUMBER='0.0.1' +fi + + +set -e + +# remove the output directory +rm -rf $TARGET + +mkdir -p $PG_BUILD_OUT +mkdir -p $PG_RUBY_PACKAGE_OUT + +bundle update + +echo "building migrations" +bundle exec pg_migrate build --source . --out $PG_BUILD_OUT + +echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "0.0.1" +bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER + + + + + diff --git a/manifest b/manifest new file mode 100644 index 000000000..e69de29bb diff --git a/up/.gitkeep b/up/.gitkeep new file mode 100644 index 000000000..e69de29bb From 275f36d122de308c523dbb9315cde8ebb0ac2fba Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Jul 2012 12:39:46 -0500 Subject: [PATCH 003/142] * updating jam-db --- README | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README b/README index f44ddd1f8..1838e4329 100644 --- a/README +++ b/README @@ -11,8 +11,22 @@ Environment ----------- * [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) -* $IVY defined as path to the [apache ivy jar](http://ant.apache.org/ivy/download.cgi). 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` - +* NOT YET: $IVY defined as path to the [apache ivy jar](http://ant.apache.org/ivy/download.cgi). 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: ff you just installed rvm, cd into this project's base directory. rvm will ask you to trust the .rvmrc. Do so. +# type ./build + +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' +` From e9ceb343ac1cea0f0a29b5eb5489e7510f0cc652 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Jul 2012 13:56:09 -0500 Subject: [PATCH 004/142] * beefing up readme some --- README | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/README b/README index 1838e4329..ab39ba3fe 100644 --- a/README +++ b/README @@ -1,13 +1,15 @@ 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 -------- -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) * 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 -------- -# one-time: ff you just installed rvm, cd into this project's base directory. rvm will ask you to trust the .rvmrc. Do so. -# type ./build +# 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 ----- @@ -27,9 +30,18 @@ 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 --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; From d1df5b9325677563178552a6fc6499a88cf326ac Mon Sep 17 00:00:00 2001 From: Jonathon Wilson Date: Sun, 29 Jul 2012 19:33:20 -0600 Subject: [PATCH 005/142] env variable. README updates. --- .gitignore | 2 ++ Gemfile | 9 ++++++++- Gemfile.lock | 22 ++++++++++++++++++++++ README | 6 ++++-- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index d913617bc..a02baa538 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ target +*.swp + diff --git a/Gemfile b/Gemfile index 9ab53af3e..6495cfe2b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,10 @@ source 'https://rubygems.org' -gem 'pg_migrate', :path=> '~/workspace/pg_migrate_ruby' +# Look for $WORKSPACE, otherwise use "workspace" as dev path. +workspace = ENV["WORKSPACE"] || "workspace" + +# Assumes you have already cloned pg_migrate_ruby in your workspace +# $ cd [workspace] +# $ git clone https://github.com/sethcall/pg_migrate_ruby + +gem 'pg_migrate', :path=> '~/' + workspace + '/pg_migrate_ruby' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..1f282a784 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,22 @@ +PATH + remote: ~/dev/pg_migrate_ruby + specs: + pg_migrate (0.1.0) + logging (= 1.7.2) + pg (= 0.14.0) + thor (= 0.15.4) + +GEM + remote: https://rubygems.org/ + specs: + little-plugger (1.1.3) + logging (1.7.2) + little-plugger (>= 1.1.3) + pg (0.14.0) + thor (0.15.4) + +PLATFORMS + ruby + +DEPENDENCIES + pg_migrate! diff --git a/README b/README index ab39ba3fe..8347f8130 100644 --- a/README +++ b/README @@ -5,14 +5,16 @@ Schema migrations for the jam-db database. Uses the [pg_migrate tool](https://g Overview -------- -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. +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. -Environmenti +Environment ----------- * [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) +* 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 * NOT YET: $IVY defined as path to the [apache ivy jar](http://ant.apache.org/ivy/download.cgi). 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 From 20be54bc67bfabe03cab7c54adb6a90f122d9aa0 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Jul 2012 21:40:18 -0500 Subject: [PATCH 006/142] * changing local reference to released gem --- Gemfile | 2 +- Gemfile.lock | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 6495cfe2b..cd0d1e58f 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,4 @@ workspace = ENV["WORKSPACE"] || "workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', :path=> '~/' + workspace + '/pg_migrate_ruby' +gem 'pg_migrate', '0.1.0' #:path=> '~/' + workspace + '/pg_migrate_ruby' diff --git a/Gemfile.lock b/Gemfile.lock index 1f282a784..bc687e3d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -PATH - remote: ~/dev/pg_migrate_ruby - specs: - pg_migrate (0.1.0) - logging (= 1.7.2) - pg (= 0.14.0) - thor (= 0.15.4) - GEM remote: https://rubygems.org/ specs: @@ -13,10 +5,14 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) + pg_migrate (0.1.0) + logging (= 1.7.2) + pg (= 0.14.0) + thor (= 0.15.4) thor (0.15.4) PLATFORMS ruby DEPENDENCIES - pg_migrate! + pg_migrate (= 0.1.0) From 30880e33cefb93b893c4d21b85cfe2003c31a2e8 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:12:44 -0500 Subject: [PATCH 007/142] * adding 'sessions.sql'. work in progress --- .pg_migrate | 2 ++ Gemfile | 2 +- Gemfile.lock | 4 ++-- README | 3 +++ build | 2 +- manifest | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .pg_migrate diff --git a/.pg_migrate b/.pg_migrate new file mode 100644 index 000000000..14b242c75 --- /dev/null +++ b/.pg_migrate @@ -0,0 +1,2 @@ +build.connopts=dbname:jam_db_build +build.oob_connopts=dbname:postgres diff --git a/Gemfile b/Gemfile index cd0d1e58f..51aea59d7 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,4 @@ workspace = ENV["WORKSPACE"] || "workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.0' #:path=> '~/' + workspace + '/pg_migrate_ruby' +gem 'pg_migrate', '0.1.3' # :path=> '~/' + workspace + '/pg_migrate_ruby' diff --git a/Gemfile.lock b/Gemfile.lock index bc687e3d3..9d1fd49f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) - pg_migrate (0.1.0) + pg_migrate (0.1.3) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -15,4 +15,4 @@ PLATFORMS ruby DEPENDENCIES - pg_migrate (= 0.1.0) + pg_migrate (= 0.1.3) diff --git a/README b/README index 8347f8130..f004f8c04 100644 --- a/README +++ b/README @@ -15,6 +15,9 @@ Environment * 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 +* you want it so the current user has access to the 'postgres' database and is a super user. 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. +# Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. +# 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](http://ant.apache.org/ivy/download.cgi). 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 diff --git a/build b/build index 301096623..8e504f306 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ mkdir -p $PG_RUBY_PACKAGE_OUT bundle update echo "building migrations" -bundle exec pg_migrate build --source . --out $PG_BUILD_OUT +bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "0.0.1" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER diff --git a/manifest b/manifest index e69de29bb..bb357703a 100644 --- a/manifest +++ b/manifest @@ -0,0 +1 @@ +sessions.sql From f7943f867fcbc209a3dc2de3bb9580de2e7cba09 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:15:27 -0500 Subject: [PATCH 008/142] * moving readme to markdown --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 31d3391e67ec0ee90328c0a4398d709549c2cd11 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:17:38 -0500 Subject: [PATCH 009/142] * trying to fix syntax issues with markdown in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f004f8c04..7e1ca4349 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Environment * 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 * you want it so the current user has access to the 'postgres' database and is a super user. 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. -# Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. -# If your user already is a superuser, then the postgres database may not exist yet. In that case, do `psql` then `create database postgres` +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](http://ant.apache.org/ivy/download.cgi). 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 From 734b7ff9480125184a64c36d6d73f09b83d47553 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:18:04 -0500 Subject: [PATCH 010/142] * trying to fix syntax issues with markdown in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7e1ca4349..43e58be33 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ Environment * 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 -* you want it so the current user has access to the 'postgres' database and is a super user. 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` +* you want it so the current user has access to the 'postgres' database and is a super user. 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. +Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. +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](http://ant.apache.org/ivy/download.cgi). 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 From 073987f823f7585b51d41dc35f0d6f7f5813179a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:19:14 -0500 Subject: [PATCH 011/142] * trying to fix syntax issues with markdown in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 43e58be33..c3f77d04f 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ Environment * 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 -* you want it so the current user has access to the 'postgres' database and is a super user. 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. -Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. -If your user already is a superuser, then the postgres database may not exist yet. In that case, do `psql` then `create database postgres` +* 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. +** Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. +** 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](http://ant.apache.org/ivy/download.cgi). 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 From b49ca33ebf86e151a56dd72fd41a32ae09b00b22 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 4 Aug 2012 22:19:40 -0500 Subject: [PATCH 012/142] * trying to fix syntax issues with markdown in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c3f77d04f..b9c149952 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Environment * 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. -** Your current user is not a superuser. If not, do `sudo su postgres -c "createuser YOURUSER"` and answer 'y' with the first question. -** If your user already is a superuser, then the postgres database may not exist yet. In that case, do `psql` then `create database postgres` +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](http://ant.apache.org/ivy/download.cgi). 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 From 920c79de36bc3f26bc89f3278219ef44ac607e3d Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 5 Aug 2012 22:01:35 -0500 Subject: [PATCH 013/142] * bump to latest pg_migrate --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 51aea59d7..160b58f1d 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,4 @@ workspace = ENV["WORKSPACE"] || "workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.3' # :path=> '~/' + workspace + '/pg_migrate_ruby' +gem 'pg_migrate', '0.1.4' # :path=> '~/' + workspace + '/pg_migrate_ruby' diff --git a/Gemfile.lock b/Gemfile.lock index 9d1fd49f0..f6c8b3457 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) - pg_migrate (0.1.3) + pg_migrate (0.1.4) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -15,4 +15,4 @@ PLATFORMS ruby DEPENDENCIES - pg_migrate (= 0.1.3) + pg_migrate (= 0.1.4) From b09174022574e00061d784cfa73c0f2de56818b4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 16 Aug 2012 22:12:29 -0500 Subject: [PATCH 014/142] * adding sessions.sq --- up/sessions.sql | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 up/sessions.sql diff --git a/up/sessions.sql b/up/sessions.sql new file mode 100644 index 000000000..4fc0132d6 --- /dev/null +++ b/up/sessions.sql @@ -0,0 +1,37 @@ +-- so we can default uuid fields using uuid_generate_v4. nice to have. +CREATE EXTENSION "uuid-ossp"; + +CREATE TABLE users ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(50) NOT NULL, + email VARCHAR(255) NOT NULL UNIQUE, + remember_token VARCHAR(255) UNIQUE, + password_digest VARCHAR(255) NOT NULL, + admin boolean NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE INDEX remember_token_idx ON users(remember_token); + +-- adhoc jam sessions +CREATE TABLE jam_sessions ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(255), + user_id VARCHAR(64) REFERENCES users(id), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- users currently in the jam session +CREATE TABLE jam_session_members ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id), + jam_session_id VARCHAR(64) REFERENCES jam_sessions(id), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE jam_session_members ADD CONSTRAINT user_jam_session_uniqkey UNIQUE (user_id, jam_session_id); + + From db1c22917f24b979856029f787e2ea16b3b575b0 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 26 Aug 2012 06:36:05 -0500 Subject: [PATCH 015/142] * bootstrap tst user into db --- Gemfile | 2 +- Gemfile.lock | 4 ++-- README.md | 2 +- up/sessions.sql | 26 ++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 160b58f1d..b48d10426 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,4 @@ workspace = ENV["WORKSPACE"] || "workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.4' # :path=> '~/' + workspace + '/pg_migrate_ruby' +gem 'pg_migrate', '0.1.5' # :path=> '~/' + workspace + '/pg_migrate_ruby' diff --git a/Gemfile.lock b/Gemfile.lock index f6c8b3457..0383b3549 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) - pg_migrate (0.1.4) + pg_migrate (0.1.5) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -15,4 +15,4 @@ PLATFORMS ruby DEPENDENCIES - pg_migrate (= 0.1.4) + pg_migrate (= 0.1.5) diff --git a/README.md b/README.md index b9c149952..283a56f25 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Then, to cause a migration, do something like: 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 +bundle exec jam_db up --connopts="dbname:jam host:localhost user:postgres password:postgres" --verbose # you can see if it worked by typing: diff --git a/up/sessions.sql b/up/sessions.sql index 4fc0132d6..294725195 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -34,4 +34,30 @@ CREATE TABLE jam_session_members ( ALTER TABLE jam_session_members ADD CONSTRAINT user_jam_session_uniqkey UNIQUE (user_id, jam_session_id); +-- create a utility method to truncate all tables + +CREATE OR REPLACE FUNCTION truncate_tables() RETURNS void AS $$ +DECLARE + statements CURSOR FOR + SELECT tablename FROM pg_tables + WHERE schemaname = 'public'; +BEGIN + FOR stmt IN statements LOOP + EXECUTE 'TRUNCATE TABLE ' || quote_ident(stmt.tablename) || ' CASCADE;'; + END LOOP; +END; +$$ LANGUAGE plpgsql; + +-- create a utility that bootstraps a user +CREATE OR REPLACE FUNCTION bootstrap_users() RETURNS void AS $$ +DECLARE + +BEGIN + -- non guid used for test user. test user won't be in actual database, but '1' is much easier to script that 242423-42-4-24234 + -- password is jam123 + INSERT INTO users (id, name, email, remember_token, password_digest) VALUES ('1', 'test', 'test@jamkazam.com', 'NQubl-z16Em94tnSdofObw', '$2a$10$QyaNTLVX5DAaJ.JL21kDWeUQqdh3Qh7JQbdRgE82x1Cib7HWNcHXC'); +END; +$$ LANGUAGE plpgsql; + +select bootstrap_users(); From 2f70c9b3c6681ad5a5d9fabd1ad4ed8797dd1a78 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 26 Aug 2012 13:27:43 -0500 Subject: [PATCH 016/142] * beefing up session name max size --- up/sessions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/sessions.sql b/up/sessions.sql index 294725195..064bd1b4f 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -17,7 +17,7 @@ CREATE INDEX remember_token_idx ON users(remember_token); -- adhoc jam sessions CREATE TABLE jam_sessions ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - name VARCHAR(255), + name VARCHAR(8000), user_id VARCHAR(64) REFERENCES users(id), created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP From 0eefd18a7587b94c0be598ecaca48e8164f1d263 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 26 Aug 2012 14:34:04 -0500 Subject: [PATCH 017/142] * fixing up workspace --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index b48d10426..2de75c187 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ source 'https://rubygems.org' # Look for $WORKSPACE, otherwise use "workspace" as dev path. -workspace = ENV["WORKSPACE"] || "workspace" +workspace = ENV["WORKSPACE"] || "~/workspace" # Assumes you have already cloned pg_migrate_ruby in your workspace # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.5' # :path=> '~/' + workspace + '/pg_migrate_ruby' +gem 'pg_migrate', '0.1.5' # :path=> "#{workspace}/pg_migrate_ruby" From 41de5c5dc29cd24b80f37b1147cce6d4080d9c6f Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Aug 2012 08:21:00 -0500 Subject: [PATCH 018/142] * adding not null contraist for creator --- up/sessions.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/up/sessions.sql b/up/sessions.sql index 064bd1b4f..dc943d1f9 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -18,7 +18,7 @@ CREATE INDEX remember_token_idx ON users(remember_token); CREATE TABLE jam_sessions ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), name VARCHAR(8000), - user_id VARCHAR(64) REFERENCES users(id), + user_id VARCHAR(64) NOT NULL REFERENCES users(id), created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); @@ -26,8 +26,8 @@ CREATE TABLE jam_sessions ( -- users currently in the jam session CREATE TABLE jam_session_members ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id), - jam_session_id VARCHAR(64) REFERENCES jam_sessions(id), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + jam_session_id VARCHAR(64) REFERENCES jam_sessions(id) ON DELETE CASCADE, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); From 18fdf4551dc146c1aa9314736afa4dd3fa62d0bf Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 2 Sep 2012 07:47:21 -0500 Subject: [PATCH 019/142] * adding public flag to jam_session --- up/sessions.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/up/sessions.sql b/up/sessions.sql index dc943d1f9..e5a30c132 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -18,6 +18,7 @@ CREATE INDEX remember_token_idx ON users(remember_token); CREATE TABLE jam_sessions ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), name VARCHAR(8000), + public boolean NOT NULL DEFAULT true, user_id VARCHAR(64) NOT NULL REFERENCES users(id), created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP From 82cc98e9bd43115578779865875742b6c1eff055 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 13 Sep 2012 23:38:55 -0500 Subject: [PATCH 020/142] * testing bitbucket integration with jira VRFS-11 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 283a56f25..4cea71c62 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,5 @@ psql jam > select * from pgmigrate.pg_migrate; +END From 562eaea8448de1a99ad2919d72a88db4c4b328ad Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 17 Sep 2012 22:38:21 -0500 Subject: [PATCH 021/142] * disabling test until pgmigrate allows specification of password argument --- .pg_migrate | 2 +- Gemfile.lock | 2 ++ build | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pg_migrate b/.pg_migrate index 14b242c75..e19fb90af 100644 --- a/.pg_migrate +++ b/.pg_migrate @@ -1,2 +1,2 @@ build.connopts=dbname:jam_db_build -build.oob_connopts=dbname:postgres +build.oob_connopts=dbname:postgres user:postgres password:postgres diff --git a/Gemfile.lock b/Gemfile.lock index 0383b3549..e82ee1e90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,7 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) + pg (0.14.0-x86-mingw32) pg_migrate (0.1.5) logging (= 1.7.2) pg (= 0.14.0) @@ -13,6 +14,7 @@ GEM PLATFORMS ruby + x86-mingw32 DEPENDENCIES pg_migrate (= 0.1.5) diff --git a/build b/build index 8e504f306..301096623 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ mkdir -p $PG_RUBY_PACKAGE_OUT bundle update echo "building migrations" -bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test +bundle exec pg_migrate build --source . --out $PG_BUILD_OUT echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "0.0.1" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER From b86ec296fcccc56da33e27cf445cd30fefd81eb9 Mon Sep 17 00:00:00 2001 From: bsmith Date: Sun, 30 Sep 2012 22:33:53 -0400 Subject: [PATCH 022/142] added more table creation scripts --- up/sessions.sql | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/up/sessions.sql b/up/sessions.sql index e5a30c132..e1eaa0351 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -35,6 +35,93 @@ CREATE TABLE jam_session_members ( ALTER TABLE jam_session_members ADD CONSTRAINT user_jam_session_uniqkey UNIQUE (user_id, jam_session_id); +CREATE TABLE connections ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + client_id VARCHAR(64) NOT NULL UNIQUE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- friendships +CREATE TABLE friendships ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE friendships ADD CONSTRAINT user_friend_uniqkey UNIQUE (user_id, friend_id); + +-- bands +CREATE TABLE bands ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(1024) NOT NULL, + -- add more fields later + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- genres +CREATE TABLE genres ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + description VARCHAR(1024) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- band -> genre mapping +CREATE TABLE bands_genres ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + genre_id VARCHAR(64) REFERENCES genres(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_genres ADD CONSTRAINT band_genre_uniqkey UNIQUE (band_id, genre_id); + +-- musicians +CREATE TABLE musicians ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- musician -> band mapping +CREATE TABLE bands_musicians ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, + is_admin BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, musician_id); + +-- instruments +CREATE TABLE instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + description VARCHAR(1024) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- musician -> instrument mapping +CREATE TABLE musicians_instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + proficiency_level SMALLINT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); + -- create a utility method to truncate all tables CREATE OR REPLACE FUNCTION truncate_tables() RETURNS void AS $$ From b5d5a422a0460e1e824cffa15e73a6a61e34fa52 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 30 Sep 2012 22:46:20 -0400 Subject: [PATCH 023/142] move user scripts to new file --- manifest | 1 + up/sessions.sql | 87 ------------------------------------------------- up/users.sql | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 87 deletions(-) create mode 100644 up/users.sql diff --git a/manifest b/manifest index bb357703a..5bf921101 100644 --- a/manifest +++ b/manifest @@ -1 +1,2 @@ sessions.sql +users.sql \ No newline at end of file diff --git a/up/sessions.sql b/up/sessions.sql index e1eaa0351..e5a30c132 100644 --- a/up/sessions.sql +++ b/up/sessions.sql @@ -35,93 +35,6 @@ CREATE TABLE jam_session_members ( ALTER TABLE jam_session_members ADD CONSTRAINT user_jam_session_uniqkey UNIQUE (user_id, jam_session_id); -CREATE TABLE connections ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - client_id VARCHAR(64) NOT NULL UNIQUE, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - --- friendships -CREATE TABLE friendships ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE friendships ADD CONSTRAINT user_friend_uniqkey UNIQUE (user_id, friend_id); - --- bands -CREATE TABLE bands ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - name VARCHAR(1024) NOT NULL, - -- add more fields later - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - --- genres -CREATE TABLE genres ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - description VARCHAR(1024) NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - --- band -> genre mapping -CREATE TABLE bands_genres ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - genre_id VARCHAR(64) REFERENCES genres(id) ON DELETE CASCADE, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE bands_genres ADD CONSTRAINT band_genre_uniqkey UNIQUE (band_id, genre_id); - --- musicians -CREATE TABLE musicians ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - --- musician -> band mapping -CREATE TABLE bands_musicians ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, - is_admin BOOLEAN NOT NULL DEFAULT false, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, musician_id); - --- instruments -CREATE TABLE instruments ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - description VARCHAR(1024) NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - --- musician -> instrument mapping -CREATE TABLE musicians_instruments ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, - instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, - proficiency_level SMALLINT NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); - -- create a utility method to truncate all tables CREATE OR REPLACE FUNCTION truncate_tables() RETURNS void AS $$ diff --git a/up/users.sql b/up/users.sql new file mode 100644 index 000000000..a9dcb9a55 --- /dev/null +++ b/up/users.sql @@ -0,0 +1,86 @@ +CREATE TABLE connections ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + client_id VARCHAR(64) NOT NULL UNIQUE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- friendships +CREATE TABLE friendships ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE friendships ADD CONSTRAINT user_friend_uniqkey UNIQUE (user_id, friend_id); + +-- bands +CREATE TABLE bands ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + name VARCHAR(1024) NOT NULL, + -- add more fields later + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- genres +CREATE TABLE genres ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + description VARCHAR(1024) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- band -> genre mapping +CREATE TABLE bands_genres ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + genre_id VARCHAR(64) REFERENCES genres(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_genres ADD CONSTRAINT band_genre_uniqkey UNIQUE (band_id, genre_id); + +-- musicians +CREATE TABLE musicians ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- musician -> band mapping +CREATE TABLE bands_musicians ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, + is_admin BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, musician_id); + +-- instruments +CREATE TABLE instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + description VARCHAR(1024) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- musician -> instrument mapping +CREATE TABLE musicians_instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + proficiency_level SMALLINT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); From f3c21dba518dbb5237d8c91486361f88d05312f0 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 2 Oct 2012 22:46:28 -0500 Subject: [PATCH 024/142] * db changes required for minimal sessions API --- build | 2 +- manifest | 1 + up/sessions_api_v1.sql | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 up/sessions_api_v1.sql diff --git a/build b/build index 301096623..d07eb2476 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ mkdir -p $PG_RUBY_PACKAGE_OUT bundle update echo "building migrations" -bundle exec pg_migrate build --source . --out $PG_BUILD_OUT +bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "0.0.1" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER diff --git a/manifest b/manifest index bb357703a..0cb632c07 100644 --- a/manifest +++ b/manifest @@ -1 +1,2 @@ sessions.sql +sessions_api_v1.sql diff --git a/up/sessions_api_v1.sql b/up/sessions_api_v1.sql new file mode 100644 index 000000000..f602b27be --- /dev/null +++ b/up/sessions_api_v1.sql @@ -0,0 +1,23 @@ +ALTER TABLE jam_sessions DROP COLUMN public; + +-- rename 'name' to 'description' to match product specification terminology +ALTER TABLE jam_sessions RENAME name TO description; + +-- rename jam_sessions to more generic 'music_sessions' +ALTER TABLE jam_sessions RENAME TO music_sessions; + +-- get rid of early version of member table +DROP TABLE jam_session_members; + +-- one row is created per connected client +CREATE TABLE music_session_clients ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE, + ip_address VARCHAR(64) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + + + From 9f4c565308533806534dad19c14ce17a861914d1 Mon Sep 17 00:00:00 2001 From: tihot_jk Date: Wed, 3 Oct 2012 00:28:27 -0700 Subject: [PATCH 025/142] Fixing the peer auth issue --- .pg_migrate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pg_migrate b/.pg_migrate index e19fb90af..00afc326e 100644 --- a/.pg_migrate +++ b/.pg_migrate @@ -1,2 +1,2 @@ build.connopts=dbname:jam_db_build -build.oob_connopts=dbname:postgres user:postgres password:postgres +build.oob_connopts=dbname:postgres user:postgres password:postgres host:localhost From 961a236deb78f2e2b4bbaed0eaf02e4f36409033 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 13 Oct 2012 17:46:40 -0500 Subject: [PATCH 026/142] * p2p.sql added--client_id added to music_session_clients table --- manifest | 1 + up/p2p.sql | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 up/p2p.sql diff --git a/manifest b/manifest index ba16d4d5e..267b046f9 100644 --- a/manifest +++ b/manifest @@ -1,3 +1,4 @@ sessions.sql users.sql sessions_api_v1.sql +p2p.sql diff --git a/up/p2p.sql b/up/p2p.sql new file mode 100644 index 000000000..f57113970 --- /dev/null +++ b/up/p2p.sql @@ -0,0 +1,2 @@ +-- begin storing a client_id in each music_session_client +ALTER TABLE music_session_clients ADD COLUMN client_id VARCHAR(64) UNIQUE; From 6e1293b6cf8d17a2ba0b5b0c2c2b76a1cae764b0 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 13 Oct 2012 22:16:31 -0400 Subject: [PATCH 027/142] added friend_requests table --- manifest | 1 + up/users_v1.sql | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 up/users_v1.sql diff --git a/manifest b/manifest index ba16d4d5e..6b2c3f1dc 100644 --- a/manifest +++ b/manifest @@ -1,3 +1,4 @@ sessions.sql users.sql sessions_api_v1.sql +users_v1.sql \ No newline at end of file diff --git a/up/users_v1.sql b/up/users_v1.sql new file mode 100644 index 000000000..e8c18c2bb --- /dev/null +++ b/up/users_v1.sql @@ -0,0 +1,11 @@ +-- friend requests +CREATE TABLE friend_requests ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + accepted BOOLEAN, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE friend_requests ADD CONSTRAINT user_friend_request_uniqkey UNIQUE (user_id, friend_id); \ No newline at end of file From fda7e61420a4e3c1c20b275dedce144807f676cc Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 20 Oct 2012 20:54:38 -0500 Subject: [PATCH 028/142] * remove music_session_clients; merge into connections table (VRFS-18 --- manifest | 1 + up/collapse_participants.sql | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 up/collapse_participants.sql diff --git a/manifest b/manifest index 267b046f9..ee46ead05 100644 --- a/manifest +++ b/manifest @@ -2,3 +2,4 @@ sessions.sql users.sql sessions_api_v1.sql p2p.sql +collapse_participants.sql diff --git a/up/collapse_participants.sql b/up/collapse_participants.sql new file mode 100644 index 000000000..f4d86a4bb --- /dev/null +++ b/up/collapse_participants.sql @@ -0,0 +1,4 @@ +DROP TABLE music_session_clients; + +ALTER TABLE connections ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); +ALTER TABLE connections ADD COLUMN ip_address VARCHAR(64); From a04bf4155503a93ec00b52c660773f27a0c10e1e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 22 Oct 2012 20:00:13 -0500 Subject: [PATCH 029/142] * cascading delete SET NULL on client_id (to stop fk's from deleting music_session) --- up/collapse_participants.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/collapse_participants.sql b/up/collapse_participants.sql index f4d86a4bb..691b0018a 100644 --- a/up/collapse_participants.sql +++ b/up/collapse_participants.sql @@ -1,4 +1,4 @@ DROP TABLE music_session_clients; -ALTER TABLE connections ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); +ALTER TABLE connections ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE SET NULL; ALTER TABLE connections ADD COLUMN ip_address VARCHAR(64); From 528611cbc9f6243b186c076a4192e8845cc37446 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 25 Oct 2012 07:09:59 -0500 Subject: [PATCH 030/142] * VRFS-21; bootstrapping genre values and also associating with sessions --- manifest | 2 ++ up/genre_session.sql | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 up/genre_session.sql diff --git a/manifest b/manifest index 04dbf523e..23a176f4a 100644 --- a/manifest +++ b/manifest @@ -3,3 +3,5 @@ users.sql sessions_api_v1.sql users_v1.sql p2p.sql +collapse_participants.sql +genre_session.sql diff --git a/up/genre_session.sql b/up/genre_session.sql new file mode 100644 index 000000000..cf18064cd --- /dev/null +++ b/up/genre_session.sql @@ -0,0 +1,27 @@ +-- sessions -> genre mapping +CREATE TABLE genres_music_sessions ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + genre_id VARCHAR(64) REFERENCES genres(id) ON DELETE CASCADE, + music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE +); + +INSERT INTO genres (description) VALUES + ('African'), + ('Ambient'), + ('Asian'), + ('Blues'), + ('Classical'), + ('Country'), + ('Electronic'), + ('Folk'), + ('Hip Hop'), + ('Jazz'), + ('Latin'), + ('Metal'), + ('Pop'), + ('R&B'), + ('Reggae'), + ('Religious'), + ('Rock'), + ('Ska'), + ('Other'); From 80637bac74b3bca8b44eaffa5eb1c5861f1aec0e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 26 Oct 2012 05:34:41 -0500 Subject: [PATCH 031/142] * VRFS-27; invitations model defined* --- manifest | 1 + up/invitations.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 up/invitations.sql diff --git a/manifest b/manifest index 23a176f4a..bb2017345 100644 --- a/manifest +++ b/manifest @@ -5,3 +5,4 @@ users_v1.sql p2p.sql collapse_participants.sql genre_session.sql +invitations.sql diff --git a/up/invitations.sql b/up/invitations.sql new file mode 100644 index 000000000..72bc8cfad --- /dev/null +++ b/up/invitations.sql @@ -0,0 +1,8 @@ +CREATE TABLE invitations ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + sender_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + receiver_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From bc10d96a9ea60ec538fe983958c5bf1acbe198f4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 27 Oct 2012 14:20:11 -0500 Subject: [PATCH 032/142] * VRFS-27 tables added --- up/invitations.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/up/invitations.sql b/up/invitations.sql index 72bc8cfad..10d8f8c10 100644 --- a/up/invitations.sql +++ b/up/invitations.sql @@ -6,3 +6,5 @@ CREATE TABLE invitations ( created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); + +ALTER TABLE invitations ADD CONSTRAINT invitations_uniqkey UNIQUE (sender_id, receiver_id, music_session_id); From b7094ce310bd8b60970ee9065eceff562f39441b Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 27 Oct 2012 17:51:26 -0500 Subject: [PATCH 033/142] * VRFS-29; musician_access flag added --- manifest | 1 + up/musician_access.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/musician_access.sql diff --git a/manifest b/manifest index bb2017345..f61253570 100644 --- a/manifest +++ b/manifest @@ -6,3 +6,4 @@ p2p.sql collapse_participants.sql genre_session.sql invitations.sql +musician_access.sql diff --git a/up/musician_access.sql b/up/musician_access.sql new file mode 100644 index 000000000..77b4e94ae --- /dev/null +++ b/up/musician_access.sql @@ -0,0 +1 @@ +ALTER TABLE music_sessions ADD COLUMN musician_access BOOLEAN NOT NULL; From 849360bb8c9f529dc29bd3f9612df1973a4f4451 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 27 Oct 2012 22:33:49 -0400 Subject: [PATCH 034/142] updates for musicians --- manifest | 1 + up/users_v2.sql | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 up/users_v2.sql diff --git a/manifest b/manifest index bb2017345..86b8f84c5 100644 --- a/manifest +++ b/manifest @@ -6,3 +6,4 @@ p2p.sql collapse_participants.sql genre_session.sql invitations.sql +users_v2.sql \ No newline at end of file diff --git a/up/users_v2.sql b/up/users_v2.sql new file mode 100644 index 000000000..5e247f3da --- /dev/null +++ b/up/users_v2.sql @@ -0,0 +1,32 @@ +drop table bands_musicians; +drop table musicians_instruments; +drop table musicians; + +ALTER TABLE users ADD COLUMN musician BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE bands ADD COLUMN website VARCHAR(4000) NULL; +ALTER TABLE bands ADD COLUMN biography VARCHAR(4000) NOT NULL; + +-- musician -> band mapping +CREATE TABLE bands_musicians ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + is_admin BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, user_id); + + +-- musician -> instrument mapping +CREATE TABLE musicians_instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + proficiency_level SMALLINT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (user_id, instrument_id); From 30e3f8f33e4e81fd16734192369cad382ab21d00 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 29 Oct 2012 06:43:52 -0400 Subject: [PATCH 035/142] added script to insert instruments --- manifest | 3 ++- up/instruments.sql | 4 ++++ up/users_v2.sql | 15 +++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 up/instruments.sql diff --git a/manifest b/manifest index 86b8f84c5..e085ff3e4 100644 --- a/manifest +++ b/manifest @@ -6,4 +6,5 @@ p2p.sql collapse_participants.sql genre_session.sql invitations.sql -users_v2.sql \ No newline at end of file +users_v2.sql +instruments.sql \ No newline at end of file diff --git a/up/instruments.sql b/up/instruments.sql new file mode 100644 index 000000000..99e7dfdb9 --- /dev/null +++ b/up/instruments.sql @@ -0,0 +1,4 @@ +insert into instruments (description) values +('Guitar'), +('Vocals'), +('Drums') \ No newline at end of file diff --git a/up/users_v2.sql b/up/users_v2.sql index 5e247f3da..805227976 100644 --- a/up/users_v2.sql +++ b/up/users_v2.sql @@ -1,13 +1,13 @@ -drop table bands_musicians; -drop table musicians_instruments; -drop table musicians; +DROP TABLE bands_musicians; +DROP TABLE musicians_instruments; +DROP TABLE musicians; ALTER TABLE users ADD COLUMN musician BOOLEAN NOT NULL DEFAULT false; ALTER TABLE bands ADD COLUMN website VARCHAR(4000) NULL; ALTER TABLE bands ADD COLUMN biography VARCHAR(4000) NOT NULL; -- musician -> band mapping -CREATE TABLE bands_musicians ( +CREATE TABLE bands_users ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, @@ -16,11 +16,10 @@ CREATE TABLE bands_musicians ( updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); -ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, user_id); - +ALTER TABLE bands_users ADD CONSTRAINT band_user_uniqkey UNIQUE (band_id, user_id); -- musician -> instrument mapping -CREATE TABLE musicians_instruments ( +CREATE TABLE users_instruments ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, @@ -29,4 +28,4 @@ CREATE TABLE musicians_instruments ( updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); -ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (user_id, instrument_id); +ALTER TABLE users_instruments ADD CONSTRAINT user_instrument_uniqkey UNIQUE (user_id, instrument_id); From 5b686517310b4009ef142b0ce90b9295daf165a3 Mon Sep 17 00:00:00 2001 From: Jonathon Wilson Date: Mon, 29 Oct 2012 08:35:10 -0600 Subject: [PATCH 036/142] Add missing semicolon --- up/instruments.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/instruments.sql b/up/instruments.sql index 99e7dfdb9..d02b79fa1 100644 --- a/up/instruments.sql +++ b/up/instruments.sql @@ -1,4 +1,4 @@ insert into instruments (description) values ('Guitar'), ('Vocals'), -('Drums') \ No newline at end of file +('Drums'); From bb7e82366ef6155b5fe4da60312c211b41d78e24 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 30 Oct 2012 01:40:52 -0400 Subject: [PATCH 037/142] renamed musician/band related user tables --- manifest | 3 ++- up/users_v3.sql | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 up/users_v3.sql diff --git a/manifest b/manifest index e085ff3e4..7329e0b7d 100644 --- a/manifest +++ b/manifest @@ -7,4 +7,5 @@ collapse_participants.sql genre_session.sql invitations.sql users_v2.sql -instruments.sql \ No newline at end of file +instruments.sql +users_v3.sql \ No newline at end of file diff --git a/up/users_v3.sql b/up/users_v3.sql new file mode 100644 index 000000000..ed0d59110 --- /dev/null +++ b/up/users_v3.sql @@ -0,0 +1,4 @@ +ALTER TABLE users_instruments RENAME TO musicians_instruments; +ALTER TABLE bands_users RENAME TO bands_musicians; + +ALTER TABLE bands_musicians rename column is_admin to admin \ No newline at end of file From 9bcc0d20146b061f83b6339cf6d98fb6e9d6158f Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 30 Oct 2012 02:15:55 -0400 Subject: [PATCH 038/142] fixed build problem --- up/users_v3.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/users_v3.sql b/up/users_v3.sql index ed0d59110..b4f7d9e41 100644 --- a/up/users_v3.sql +++ b/up/users_v3.sql @@ -1,4 +1,4 @@ ALTER TABLE users_instruments RENAME TO musicians_instruments; ALTER TABLE bands_users RENAME TO bands_musicians; -ALTER TABLE bands_musicians rename column is_admin to admin \ No newline at end of file +ALTER TABLE bands_musicians rename column is_admin to admin; \ No newline at end of file From 175f6e4f805a3f126fccaaca06ee252c8215c961 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 30 Oct 2012 06:54:37 -0500 Subject: [PATCH 039/142] * adding ruby decl at top to quiet trust question of rvm --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 2de75c187..1cf065ceb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +#ruby=1.9.3 source 'https://rubygems.org' # Look for $WORKSPACE, otherwise use "workspace" as dev path. From 6649b09715027e414535a383562c8e89f41fbc62 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 30 Oct 2012 07:26:40 -0500 Subject: [PATCH 040/142] * trying to execute a login shell instead --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index d07eb2476..78aca15f1 100755 --- a/build +++ b/build @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l TARGET=target PG_BUILD_OUT=$TARGET/build From ba1aa4e01a2adc7946a5b0edc184b1e79d74b70a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 1 Nov 2012 17:25:03 -0500 Subject: [PATCH 041/142] * working on gem builds --- Gemfile.lock | 2 ++ build | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e82ee1e90..72d502717 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,6 @@ GEM remote: https://rubygems.org/ + remote: https://66.228.51.157/ specs: little-plugger (1.1.3) logging (1.7.2) @@ -17,4 +18,5 @@ PLATFORMS x86-mingw32 DEPENDENCIES + logging pg_migrate (= 0.1.5) diff --git a/build b/build index 78aca15f1..282389a30 100755 --- a/build +++ b/build @@ -6,7 +6,7 @@ PG_RUBY_PACKAGE_OUT=$TARGET/ruby_package PROJECT_NAME="jam_db" if [ -z $BUILD_NUMBER ]; then - BUILD_NUMBER='0.0.1' + BUILD_NUMBER="0.0.${BUILD_NUMBER}" fi @@ -23,7 +23,7 @@ bundle update echo "building migrations" bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose -echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "0.0.1" +echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$BUILD_NUMBER" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER From 7f518805091e589af9692d023f5e4b2658b04860 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 2 Nov 2012 01:51:40 -0500 Subject: [PATCH 042/142] * fixnig build script to work again with no BUILD NUMBER specified --- Gemfile.lock | 2 -- build | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 72d502717..e82ee1e90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,5 @@ GEM remote: https://rubygems.org/ - remote: https://66.228.51.157/ specs: little-plugger (1.1.3) logging (1.7.2) @@ -18,5 +17,4 @@ PLATFORMS x86-mingw32 DEPENDENCIES - logging pg_migrate (= 0.1.5) diff --git a/build b/build index 282389a30..9fc4ec1ab 100755 --- a/build +++ b/build @@ -6,9 +6,10 @@ PG_RUBY_PACKAGE_OUT=$TARGET/ruby_package PROJECT_NAME="jam_db" if [ -z $BUILD_NUMBER ]; then - BUILD_NUMBER="0.0.${BUILD_NUMBER}" + BUILD_NUMBER="1" fi +VERSION="0.0.${BUILD_NUMBER}" set -e @@ -23,10 +24,5 @@ bundle update echo "building migrations" bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose -echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$BUILD_NUMBER" -bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER - - - - - +echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$VERSION" +bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $VERSION From e65c817024e6c043220b32398d001c071a4e0ae4 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 3 Nov 2012 15:25:18 -0400 Subject: [PATCH 043/142] update musicians_instruments table --- manifest | 3 ++- up/locations.sql | 11 +++++++++++ up/musicians_instruments.sql | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 up/locations.sql create mode 100644 up/musicians_instruments.sql diff --git a/manifest b/manifest index 7329e0b7d..fc9fe1de8 100644 --- a/manifest +++ b/manifest @@ -8,4 +8,5 @@ genre_session.sql invitations.sql users_v2.sql instruments.sql -users_v3.sql \ No newline at end of file +users_v3.sql +musicians_instruments.sql \ No newline at end of file diff --git a/up/locations.sql b/up/locations.sql new file mode 100644 index 000000000..cb69807a6 --- /dev/null +++ b/up/locations.sql @@ -0,0 +1,11 @@ +-- locations +CREATE TABLE musicians_instruments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + proficiency_level SMALLINT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); diff --git a/up/musicians_instruments.sql b/up/musicians_instruments.sql new file mode 100644 index 000000000..37a6f6a24 --- /dev/null +++ b/up/musicians_instruments.sql @@ -0,0 +1,3 @@ +ALTER TABLE musicians_instruments ALTER COLUMN user_id SET NOT NULL; +ALTER TABLE musicians_instruments ALTER COLUMN instrument_id SET NOT NULL; +ALTER TABLE musicians_instruments ADD COLUMN priority SMALLINT NOT NULL DEFAULT 1; From 63e622be4afc8f488af17461d691971350c82b3f Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 3 Nov 2012 21:48:20 -0500 Subject: [PATCH 044/142] * VRFS-34 and VRFS-61; session.tracks and instruments --- manifest | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest b/manifest index 5916b057d..d9d725df5 100644 --- a/manifest +++ b/manifest @@ -10,3 +10,4 @@ users_v2.sql instruments.sql users_v3.sql musician_access.sql +tracks.sql From 681fc6e5eaae008fcd2f45c83434851792501ea2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 3 Nov 2012 21:48:42 -0500 Subject: [PATCH 045/142] * VRFS-34 and VRFS-61; session.tracks and instruments --- up/tracks.sql | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 up/tracks.sql diff --git a/up/tracks.sql b/up/tracks.sql new file mode 100644 index 000000000..af261a328 --- /dev/null +++ b/up/tracks.sql @@ -0,0 +1,41 @@ +CREATE TABLE connections_tracks ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + connection_id VARCHAR(64) REFERENCES connections(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + sound VARCHAR(64) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +UPDATE genres set id = lower(description); + +DELETE FROM instruments; + +--popularity: 3 High, 2 Mid, 1 Low, 0 user-defined +ALTER TABLE instruments ADD COLUMN popularity INTEGER NOT NULL DEFAULT 0; + +INSERT INTO instruments (id, description, popularity) VALUES + ('acoustic guitar', 'Acoustic Guitar', 3), + ('bass guitar', 'Bass Guitar', 3), + ('computer', 'Computer', 3), + ('drums', 'Drums', 3), + ('electric guitar', 'Electric Guitar', 3), + ('keyboard', 'Keyboard', 3), + ('voice', 'Voice', 3), + ('flute', 'Flute', 2), + ('clarinet', 'Clarinet', 2), + ('saxophone', 'Saxophone', 2), + ('trumpet', 'Trumpet', 2), + ('violin', 'Violin', 2), + ('trombone', 'Trombone', 2), + ('banjo', 'Banjo', 2), + ('harmonica', 'Harmonica', 2), + ('accordion', 'Accordion', 2), + ('french horn', 'French Horn', 1), + ('euphonium', 'Euphonium', 1), + ('tuba', 'Tuba', 1), + ('oboe', 'Oboe', 1), + ('ukulele', 'Ukulele', 1), + ('cello', 'Cello', 1), + ('viola', 'Viola', 1), + ('mandolin', 'Mandolin', 1); From b3db03ff66dd086f9335b317c93682e63eedb05d Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 3 Nov 2012 23:56:08 -0400 Subject: [PATCH 046/142] cleaned up scripts --- manifest | 4 ---- up/locations.sql | 11 ---------- up/musicians_instruments.sql | 3 --- up/users.sql | 39 ++++++++++++++++++++++-------------- up/users_v1.sql | 11 ---------- up/users_v2.sql | 31 ---------------------------- up/users_v3.sql | 4 ---- 7 files changed, 24 insertions(+), 79 deletions(-) delete mode 100644 up/locations.sql delete mode 100644 up/musicians_instruments.sql delete mode 100644 up/users_v1.sql delete mode 100644 up/users_v2.sql delete mode 100644 up/users_v3.sql diff --git a/manifest b/manifest index 7c97b4cfb..abaf93b9b 100644 --- a/manifest +++ b/manifest @@ -1,13 +1,9 @@ sessions.sql users.sql sessions_api_v1.sql -users_v1.sql p2p.sql collapse_participants.sql genre_session.sql invitations.sql -users_v2.sql instruments.sql -users_v3.sql -musicians_instruments.sql musician_access.sql diff --git a/up/locations.sql b/up/locations.sql deleted file mode 100644 index cb69807a6..000000000 --- a/up/locations.sql +++ /dev/null @@ -1,11 +0,0 @@ --- locations -CREATE TABLE musicians_instruments ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, - instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, - proficiency_level SMALLINT NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); diff --git a/up/musicians_instruments.sql b/up/musicians_instruments.sql deleted file mode 100644 index 37a6f6a24..000000000 --- a/up/musicians_instruments.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE musicians_instruments ALTER COLUMN user_id SET NOT NULL; -ALTER TABLE musicians_instruments ALTER COLUMN instrument_id SET NOT NULL; -ALTER TABLE musicians_instruments ADD COLUMN priority SMALLINT NOT NULL DEFAULT 1; diff --git a/up/users.sql b/up/users.sql index a9dcb9a55..69c2bd369 100644 --- a/up/users.sql +++ b/up/users.sql @@ -17,11 +17,24 @@ CREATE TABLE friendships ( ALTER TABLE friendships ADD CONSTRAINT user_friend_uniqkey UNIQUE (user_id, friend_id); +-- friend requests +CREATE TABLE friend_requests ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + accepted BOOLEAN, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE friend_requests ADD CONSTRAINT user_friend_request_uniqkey UNIQUE (user_id, friend_id); + -- bands CREATE TABLE bands ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), name VARCHAR(1024) NOT NULL, - -- add more fields later + website VARCHAR(4000) NULL, + biography VARCHAR(4000) NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); @@ -45,25 +58,17 @@ CREATE TABLE bands_genres ( ALTER TABLE bands_genres ADD CONSTRAINT band_genre_uniqkey UNIQUE (band_id, genre_id); --- musicians -CREATE TABLE musicians ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -- musician -> band mapping CREATE TABLE bands_musicians ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, - is_admin BOOLEAN NOT NULL DEFAULT false, + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + admin BOOLEAN NOT NULL DEFAULT false, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); -ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, musician_id); +ALTER TABLE bands_musicians ADD CONSTRAINT band_musician_uniqkey UNIQUE (band_id, user_id); -- instruments CREATE TABLE instruments ( @@ -76,11 +81,15 @@ CREATE TABLE instruments ( -- musician -> instrument mapping CREATE TABLE musicians_instruments ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - musician_id VARCHAR(64) REFERENCES musicians(id) ON DELETE CASCADE, - instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) NOT NULL REFERENCES instruments(id) ON DELETE CASCADE, proficiency_level SMALLINT NOT NULL, + priority SMALLINT NOT NULL DEFAULT 1, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); -ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (musician_id, instrument_id); +ALTER TABLE musicians_instruments ADD CONSTRAINT musician_instrument_uniqkey UNIQUE (user_id, instrument_id); + +-- add musician flag to users table +ALTER TABLE users ADD COLUMN musician BOOLEAN NOT NULL DEFAULT false; diff --git a/up/users_v1.sql b/up/users_v1.sql deleted file mode 100644 index e8c18c2bb..000000000 --- a/up/users_v1.sql +++ /dev/null @@ -1,11 +0,0 @@ --- friend requests -CREATE TABLE friend_requests ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - friend_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - accepted BOOLEAN, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE friend_requests ADD CONSTRAINT user_friend_request_uniqkey UNIQUE (user_id, friend_id); \ No newline at end of file diff --git a/up/users_v2.sql b/up/users_v2.sql deleted file mode 100644 index 805227976..000000000 --- a/up/users_v2.sql +++ /dev/null @@ -1,31 +0,0 @@ -DROP TABLE bands_musicians; -DROP TABLE musicians_instruments; -DROP TABLE musicians; - -ALTER TABLE users ADD COLUMN musician BOOLEAN NOT NULL DEFAULT false; -ALTER TABLE bands ADD COLUMN website VARCHAR(4000) NULL; -ALTER TABLE bands ADD COLUMN biography VARCHAR(4000) NOT NULL; - --- musician -> band mapping -CREATE TABLE bands_users ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - is_admin BOOLEAN NOT NULL DEFAULT false, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE bands_users ADD CONSTRAINT band_user_uniqkey UNIQUE (band_id, user_id); - --- musician -> instrument mapping -CREATE TABLE users_instruments ( - id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, - instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, - proficiency_level SMALLINT NOT NULL, - created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -ALTER TABLE users_instruments ADD CONSTRAINT user_instrument_uniqkey UNIQUE (user_id, instrument_id); diff --git a/up/users_v3.sql b/up/users_v3.sql deleted file mode 100644 index b4f7d9e41..000000000 --- a/up/users_v3.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE users_instruments RENAME TO musicians_instruments; -ALTER TABLE bands_users RENAME TO bands_musicians; - -ALTER TABLE bands_musicians rename column is_admin to admin; \ No newline at end of file From c6a3e7957c64d4d0dd0ab63d0433b4a290382b0c Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 4 Nov 2012 08:32:14 -0500 Subject: [PATCH 047/142] added users_followers table --- manifest | 1 + up/followers.sql | 19 +++++++++++++++++++ up/users.sql | 8 ++++---- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 up/followers.sql diff --git a/manifest b/manifest index 87e657da6..3b1bfcc95 100644 --- a/manifest +++ b/manifest @@ -8,3 +8,4 @@ invitations.sql instruments.sql musician_access.sql tracks.sql +followers.sql \ No newline at end of file diff --git a/up/followers.sql b/up/followers.sql new file mode 100644 index 000000000..367201b8a --- /dev/null +++ b/up/followers.sql @@ -0,0 +1,19 @@ +CREATE TABLE users_followers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + follower_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE users_followers ADD CONSTRAINT user_follower_uniqkey UNIQUE (user_id, follower_id); + +CREATE TABLE bands_followers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) NOT NULL REFERENCES bands(id) ON DELETE CASCADE, + follower_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_followers ADD CONSTRAINT band_follower_uniqkey UNIQUE (band_id, follower_id); \ No newline at end of file diff --git a/up/users.sql b/up/users.sql index 69c2bd369..0af957a9c 100644 --- a/up/users.sql +++ b/up/users.sql @@ -50,8 +50,8 @@ CREATE TABLE genres ( -- band -> genre mapping CREATE TABLE bands_genres ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - genre_id VARCHAR(64) REFERENCES genres(id) ON DELETE CASCADE, + band_id VARCHAR(64) NOT NULL REFERENCES bands(id) ON DELETE CASCADE, + genre_id VARCHAR(64) NOT NULL REFERENCES genres(id) ON DELETE CASCADE, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); @@ -61,8 +61,8 @@ ALTER TABLE bands_genres ADD CONSTRAINT band_genre_uniqkey UNIQUE (band_id, genr -- musician -> band mapping CREATE TABLE bands_musicians ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, - user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + band_id VARCHAR(64) NOT NULL REFERENCES bands(id) ON DELETE CASCADE, + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, admin BOOLEAN NOT NULL DEFAULT false, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP From 4822bf161fd7f03ae8cbfae852e198413f5208fe Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 5 Nov 2012 21:54:26 -0500 Subject: [PATCH 048/142] add location fields --- manifest | 3 ++- up/locations.sql | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 up/locations.sql diff --git a/manifest b/manifest index 3b1bfcc95..b6acab26a 100644 --- a/manifest +++ b/manifest @@ -8,4 +8,5 @@ invitations.sql instruments.sql musician_access.sql tracks.sql -followers.sql \ No newline at end of file +followers.sql +locations.sql \ No newline at end of file diff --git a/up/locations.sql b/up/locations.sql new file mode 100644 index 000000000..ac961480a --- /dev/null +++ b/up/locations.sql @@ -0,0 +1,7 @@ +ALTER TABLE users ADD COLUMN city VARCHAR(100) NOT NULL DEFAULT 'City'; +ALTER TABLE users ADD COLUMN state VARCHAR(2); +ALTER TABLE users ADD COLUMN country VARCHAR(100); + +ALTER TABLE bands ADD COLUMN city VARCHAR(100) NOT NULL DEFAULT 'City'; +ALTER TABLE bands ADD COLUMN state VARCHAR(2); +ALTER TABLE bands ADD COLUMN country VARCHAR(100); \ No newline at end of file From 2872175b86633730140b03354024f434b80af0e0 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 7 Nov 2012 06:56:59 -0600 Subject: [PATCH 049/142] * bumping to pg_migrate 1.6 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 1cf065ceb..3a00ca934 100644 --- a/Gemfile +++ b/Gemfile @@ -8,4 +8,4 @@ workspace = ENV["WORKSPACE"] || "~/workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.5' # :path=> "#{workspace}/pg_migrate_ruby" +gem 'pg_migrate', '0.1.6' # :path=> "#{workspace}/pg_migrate_ruby" diff --git a/Gemfile.lock b/Gemfile.lock index e82ee1e90..7f2d466c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ GEM little-plugger (>= 1.1.3) pg (0.14.0) pg (0.14.0-x86-mingw32) - pg_migrate (0.1.5) + pg_migrate (0.1.6) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -17,4 +17,4 @@ PLATFORMS x86-mingw32 DEPENDENCIES - pg_migrate (= 0.1.5) + pg_migrate (= 0.1.6) From 0914d6ff22cf32083533802e2ed98e9edc0bb805 Mon Sep 17 00:00:00 2001 From: Jonathon Wilson Date: Thu, 8 Nov 2012 09:57:28 -0700 Subject: [PATCH 050/142] Up pg_migrate version to 0.1.6 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 1cf065ceb..3a00ca934 100644 --- a/Gemfile +++ b/Gemfile @@ -8,4 +8,4 @@ workspace = ENV["WORKSPACE"] || "~/workspace" # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.5' # :path=> "#{workspace}/pg_migrate_ruby" +gem 'pg_migrate', '0.1.6' # :path=> "#{workspace}/pg_migrate_ruby" diff --git a/Gemfile.lock b/Gemfile.lock index e82ee1e90..7f2d466c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ GEM little-plugger (>= 1.1.3) pg (0.14.0) pg (0.14.0-x86-mingw32) - pg_migrate (0.1.5) + pg_migrate (0.1.6) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -17,4 +17,4 @@ PLATFORMS x86-mingw32 DEPENDENCIES - pg_migrate (= 0.1.5) + pg_migrate (= 0.1.6) From a361e14a6e51dd1f39dd1c53796806ab769a7891 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 10 Nov 2012 23:24:28 -0500 Subject: [PATCH 051/142] added first and last name fields --- manifest | 3 ++- up/first_last_name.sql | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 up/first_last_name.sql diff --git a/manifest b/manifest index b6acab26a..ed2f57e41 100644 --- a/manifest +++ b/manifest @@ -9,4 +9,5 @@ instruments.sql musician_access.sql tracks.sql followers.sql -locations.sql \ No newline at end of file +locations.sql +first_last_name.sql \ No newline at end of file diff --git a/up/first_last_name.sql b/up/first_last_name.sql new file mode 100644 index 000000000..e8f6db7ee --- /dev/null +++ b/up/first_last_name.sql @@ -0,0 +1,2 @@ +ALTER TABLE users ADD COLUMN first_name varchar(50) NOT NULL DEFAULT 'Test'; +ALTER TABLE users ADD COLUMN last_name varchar(50) NOT NULL DEFAULT 'User'; \ No newline at end of file From 40710bc0fac705f76862c6af5a38415d0dd8a6da Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 12 Nov 2012 07:00:13 -0600 Subject: [PATCH 052/142] * VRFS-72 --- manifest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest b/manifest index b6acab26a..daa34ffe3 100644 --- a/manifest +++ b/manifest @@ -9,4 +9,5 @@ instruments.sql musician_access.sql tracks.sql followers.sql -locations.sql \ No newline at end of file +locations.sql +signup.sql From cc9168f9adf8a76d6d4624dba7aeaaf318bc2ab1 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 12 Nov 2012 21:51:37 -0500 Subject: [PATCH 053/142] add account data --- manifest | 3 ++- up/account_fields.sql | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 up/account_fields.sql diff --git a/manifest b/manifest index ed2f57e41..e30854ae0 100644 --- a/manifest +++ b/manifest @@ -10,4 +10,5 @@ musician_access.sql tracks.sql followers.sql locations.sql -first_last_name.sql \ No newline at end of file +first_last_name.sql +account_fields.sql \ No newline at end of file diff --git a/up/account_fields.sql b/up/account_fields.sql new file mode 100644 index 000000000..94568227e --- /dev/null +++ b/up/account_fields.sql @@ -0,0 +1,3 @@ +ALTER TABLE users ADD COLUMN birth_date DATE NOT NULL DEFAULT '07/07/1978'; +ALTER TABLE users ADD COLUMN gender CHAR(1) NOT NULL DEFAULT 'M'; +ALTER TABLE users ADD COLUMN internet_service_provider VARCHAR(50); \ No newline at end of file From 7982eec7798ab6597510427234a196e6b2b1bf5e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 12 Nov 2012 22:15:27 -0600 Subject: [PATCH 054/142] * adding signup VRFS-72 --- up/signup.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 up/signup.sql diff --git a/up/signup.sql b/up/signup.sql new file mode 100644 index 000000000..ba2ae59ba --- /dev/null +++ b/up/signup.sql @@ -0,0 +1,2 @@ +ALTER TABLE users ADD COLUMN signup_token VARCHAR(255) UNIQUE; +ALTER TABLE users ADD COLUMN email_confirmed BOOLEAN DEFAULT FALSE; From 166e3f26f1d9a8fc3f31c76c2654c43bc61e19f5 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 13 Nov 2012 13:14:48 -0800 Subject: [PATCH 055/142] modified manifest --- manifest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest b/manifest index b6acab26a..3754ec206 100644 --- a/manifest +++ b/manifest @@ -9,4 +9,5 @@ instruments.sql musician_access.sql tracks.sql followers.sql -locations.sql \ No newline at end of file +locations.sql +user_authorizations.sql From 32c1f07bb7784598b7e3efdcffe7b4f86d45bb2c Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 13 Nov 2012 23:36:41 -0600 Subject: [PATCH 056/142] * VRFS-88; had to mark the test user as 'email_confirmed' --- manifest | 1 + up/bootstrap_users_v2.sql | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 up/bootstrap_users_v2.sql diff --git a/manifest b/manifest index dabf7d3c7..dc86ec840 100644 --- a/manifest +++ b/manifest @@ -13,3 +13,4 @@ locations.sql first_last_name.sql account_fields.sql signup.sql +bootstrap_users_v2.sql diff --git a/up/bootstrap_users_v2.sql b/up/bootstrap_users_v2.sql new file mode 100644 index 000000000..a8e686d48 --- /dev/null +++ b/up/bootstrap_users_v2.sql @@ -0,0 +1,22 @@ +-- create a utility that bootstraps a user +CREATE OR REPLACE FUNCTION bootstrap_users() RETURNS void AS $$ +DECLARE + test_user VARCHAR(64); +BEGIN +-- non guid used for test user. test user won't be in actual database, but '1' is much easier to script that 242423-42-4-24234 +-- password is jam123 + SELECT id INTO STRICT test_user FROM users WHERE id = '1'; + + UPDATE users SET name = 'test', email = 'test@jamkazam.com', remember_token = 'NQubl-z16Em94tnSdofObw', password_digest = '$2a$10$QyaNTLVX5DAaJ.JL21kDWeUQqdh3Qh7JQbdRgE82x1Cib7HWNcHXC', email_confirmed=true WHERE id = '1'; + + EXCEPTION + WHEN NO_DATA_FOUND THEN + INSERT INTO users (id, name, email, remember_token, password_digest, email_confirmed) VALUES ('1', 'test', 'test@jamkazam.com', 'NQubl-z16Em94tnSdofObw', '$2a$10$QyaNTLVX5DAaJ.JL21kDWeUQqdh3Qh7JQbdRgE82x1Cib7HWNcHXC', true); + RETURN; + WHEN TOO_MANY_ROWS THEN + RAISE EXCEPTION 'user id 1 not unique'; +END; +$$ LANGUAGE plpgsql; + +select bootstrap_users(); + From 12e72d8c5f3666c2f540cd614ff808d2c82e1995 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 14 Nov 2012 22:24:07 -0500 Subject: [PATCH 057/142] VRFS-89, VRFS-90 remove name from user model --- manifest | 1 + up/drop_users_name.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/drop_users_name.sql diff --git a/manifest b/manifest index dc86ec840..0603f8c5e 100644 --- a/manifest +++ b/manifest @@ -14,3 +14,4 @@ first_last_name.sql account_fields.sql signup.sql bootstrap_users_v2.sql +drop_users_name.sql \ No newline at end of file diff --git a/up/drop_users_name.sql b/up/drop_users_name.sql new file mode 100644 index 000000000..0b41693e6 --- /dev/null +++ b/up/drop_users_name.sql @@ -0,0 +1 @@ +alter table users drop column name; \ No newline at end of file From a56e9e08e7d3144bdb251afb9a4a0e248331396a Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Thu, 15 Nov 2012 01:31:18 -0800 Subject: [PATCH 058/142] minor readme change --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4cea71c62..7ca4b55e6 100644 --- a/README.md +++ b/README.md @@ -49,5 +49,11 @@ psql jam > select * from pgmigrate.pg_migrate; + +# If your database is screwed up, do this: +dropdb jam +createdb jam +migrate.sh + END From b450620433a01e699328ed68c9305711d0dabdcd Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 15 Nov 2012 21:04:35 -0500 Subject: [PATCH 059/142] VRFS-81 recordings and favorites --- manifest | 4 +++- up/favorites.sql | 9 +++++++++ up/recordings.sql | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 up/favorites.sql create mode 100644 up/recordings.sql diff --git a/manifest b/manifest index 0603f8c5e..f56858088 100644 --- a/manifest +++ b/manifest @@ -14,4 +14,6 @@ first_last_name.sql account_fields.sql signup.sql bootstrap_users_v2.sql -drop_users_name.sql \ No newline at end of file +drop_users_name.sql +recordings.sql +favorites.sql \ No newline at end of file diff --git a/up/favorites.sql b/up/favorites.sql new file mode 100644 index 000000000..6cf4083f8 --- /dev/null +++ b/up/favorites.sql @@ -0,0 +1,9 @@ +CREATE TABLE users_favorites ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE users_favorites ADD CONSTRAINT user_favorite_uniqkey UNIQUE (user_id, recording_id); diff --git a/up/recordings.sql b/up/recordings.sql new file mode 100644 index 000000000..f5776a073 --- /dev/null +++ b/up/recordings.sql @@ -0,0 +1,21 @@ +CREATE TABLE recordings ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + description VARCHAR(200) NOT NULL, + public BOOLEAN NOT NULL DEFAULT true, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE musicians_recordings ( + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE +); + +ALTER TABLE musicians_recordings ADD CONSTRAINT musician_recording_uniqkey UNIQUE (user_id, recording_id); + +CREATE TABLE bands_recordings ( + band_id VARCHAR(64) NOT NULL REFERENCES bands(id) ON DELETE CASCADE, + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE +); + +ALTER TABLE bands_recordings ADD CONSTRAINT band_recording_uniqkey UNIQUE (band_id, recording_id); \ No newline at end of file From 81d7358380375f03f8fc09e7d4353819648a12c4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 15 Nov 2012 20:48:29 -0600 Subject: [PATCH 060/142] * VRFS-92 stub out music session params --- manifest | 1 + up/music_session_all_params.sql | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 up/music_session_all_params.sql diff --git a/manifest b/manifest index dc86ec840..a4256fa1d 100644 --- a/manifest +++ b/manifest @@ -14,3 +14,4 @@ first_last_name.sql account_fields.sql signup.sql bootstrap_users_v2.sql +music_session_all_params.sql diff --git a/up/music_session_all_params.sql b/up/music_session_all_params.sql new file mode 100644 index 000000000..5ba065fb5 --- /dev/null +++ b/up/music_session_all_params.sql @@ -0,0 +1,12 @@ +ALTER TABLE music_sessions ADD COLUMN band_id VARCHAR(64) REFERENCES bands(id); +ALTER TABLE music_sessions ADD COLUMN approval_required BOOLEAN NOT NULL; +ALTER TABLE music_sessions ADD COLUMN fan_access BOOLEAN NOT NULL; +ALTER TABLE music_sessions ADD COLUMN fan_chat BOOLEAN NOT NULL; +CREATE TABLE fan_invitations ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + sender_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + receiver_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From 7e6276e04c34befd58a9d9cf513528545e4bc062 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 15 Nov 2012 20:49:50 -0600 Subject: [PATCH 061/142] * hiding vim files --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a02baa538..f2572c3ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ target - +*~ *.swp From 5b6360c7093504389a9bd01c4d084b975b699087 Mon Sep 17 00:00:00 2001 From: Jonathon Wilson Date: Sat, 17 Nov 2012 13:39:24 -0600 Subject: [PATCH 062/142] Point at 127.0.0.1 to avoid unix sockets --- .pg_migrate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pg_migrate b/.pg_migrate index 00afc326e..f4e8722af 100644 --- a/.pg_migrate +++ b/.pg_migrate @@ -1,2 +1,2 @@ -build.connopts=dbname:jam_db_build -build.oob_connopts=dbname:postgres user:postgres password:postgres host:localhost +build.connopts=dbname:jam_db_build user:postgres password:postgres host:127.0.0.1 +build.oob_connopts=dbname:postgres user:postgres password:postgres host:127.0.0.1 From 97580572b79aaa7f87bd42a041a6d32594aafbf2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 15:14:34 -0600 Subject: [PATCH 063/142] * VRFS-100; as_musician added to connection table --- manifest | 1 + up/as_musician.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/as_musician.sql diff --git a/manifest b/manifest index 874ad1291..247596ad4 100644 --- a/manifest +++ b/manifest @@ -17,3 +17,4 @@ bootstrap_users_v2.sql drop_users_name.sql user_authorizations.sql music_session_all_params.sql +as_musician.sql diff --git a/up/as_musician.sql b/up/as_musician.sql new file mode 100644 index 000000000..9a52de0c2 --- /dev/null +++ b/up/as_musician.sql @@ -0,0 +1 @@ +ALTER TABLE connections ADD COLUMN as_musician BOOLEAN; From 68ce5fd2460aa296f759cd5d35f5100abd90dfe4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 22:00:38 -0600 Subject: [PATCH 064/142] * VRFS-114 ; default test user is now a musician --- manifest | 1 + up/bootstrap_users_v3.sql | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 up/bootstrap_users_v3.sql diff --git a/manifest b/manifest index c0b87a3d3..c9ec13226 100644 --- a/manifest +++ b/manifest @@ -20,3 +20,4 @@ favorites.sql user_authorizations.sql music_session_all_params.sql as_musician.sql +bootstrap_users_v3.sql diff --git a/up/bootstrap_users_v3.sql b/up/bootstrap_users_v3.sql new file mode 100644 index 000000000..d3e0f3e60 --- /dev/null +++ b/up/bootstrap_users_v3.sql @@ -0,0 +1,22 @@ +-- create a utility that bootstraps a user +CREATE OR REPLACE FUNCTION bootstrap_users() RETURNS void AS $$ +DECLARE + test_user VARCHAR(64); +BEGIN +-- non guid used for test user. test user won't be in actual database, but '1' is much easier to script that 242423-42-4-24234 +-- password is jam123 + SELECT id INTO STRICT test_user FROM users WHERE id = '1'; + + UPDATE users SET first_name = 'Test', last_name = 'User', email = 'test@jamkazam.com', remember_token = 'NQubl-z16Em94tnSdofObw', password_digest = '$2a$10$QyaNTLVX5DAaJ.JL21kDWeUQqdh3Qh7JQbdRgE82x1Cib7HWNcHXC', email_confirmed=true, musician=true WHERE id = '1'; + + EXCEPTION + WHEN NO_DATA_FOUND THEN + INSERT INTO users (id, first_name, last_name, email, remember_token, password_digest, email_confirmed, musician) VALUES ('1', 'Test', 'User', 'test@jamkazam.com', 'NQubl-z16Em94tnSdofObw', '$2a$10$QyaNTLVX5DAaJ.JL21kDWeUQqdh3Qh7JQbdRgE82x1Cib7HWNcHXC', true, true); + RETURN; + WHEN TOO_MANY_ROWS THEN + RAISE EXCEPTION 'user id 1 not unique'; +END; +$$ LANGUAGE plpgsql; + +select bootstrap_users(); + From b94e20ffadab9dd3793d952896f2e6e1f5c045e6 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:21:14 -0600 Subject: [PATCH 065/142] * adding jenkins build script --- jenkins | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 jenkins diff --git a/jenkins b/jenkins new file mode 100755 index 000000000..5c80a3ba3 --- /dev/null +++ b/jenkins @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "starting build..." +./build + +if [ "$?" = "0" ]; then + echo "build succeeded" + echo "publishing gem" + pushd "target/ruby_package" + curl -T *.gem http://localhost:9000/gems + popd + echo "done publishing gems" +else + echo "build failed" +fi + + From 5c17f89a246b5b81eeebff5b15d33c8ec2dddd2e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:23:58 -0600 Subject: [PATCH 066/142] * jenkins script fails if curl push fails --- jenkins | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jenkins b/jenkins index 5c80a3ba3..5d1ba94b8 100755 --- a/jenkins +++ b/jenkins @@ -8,10 +8,16 @@ if [ "$?" = "0" ]; then echo "publishing gem" pushd "target/ruby_package" curl -T *.gem http://localhost:9000/gems + + if [ "$?" != "0" ]; then + "publish failed" + exit 1 + fi popd echo "done publishing gems" else echo "build failed" + exit 1 fi From bac868558ce106c854dc5a7c1be6f64323a8a603 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:26:42 -0600 Subject: [PATCH 067/142] * fail on error for curl --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index 5d1ba94b8..8770f0288 100755 --- a/jenkins +++ b/jenkins @@ -7,7 +7,7 @@ if [ "$?" = "0" ]; then echo "build succeeded" echo "publishing gem" pushd "target/ruby_package" - curl -T *.gem http://localhost:9000/gems + curl -f -T *.gem http://localhost:9000/gems if [ "$?" != "0" ]; then "publish failed" From 6943ec207d3401f2ad39169ce8cb43cd8d3bfa08 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:38:46 -0600 Subject: [PATCH 068/142] * tested version of jenkins script; should work this time --- jenkins | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jenkins b/jenkins index 8770f0288..b80360438 100755 --- a/jenkins +++ b/jenkins @@ -1,5 +1,7 @@ #!/bin/bash +GEM_SERVER=http://localhost:9000/gems + echo "starting build..." ./build @@ -7,10 +9,10 @@ if [ "$?" = "0" ]; then echo "build succeeded" echo "publishing gem" pushd "target/ruby_package" - curl -f -T *.gem http://localhost:9000/gems + find . -name *.gem -exec curl -f -T {} $GEM_SERVER/{} \; if [ "$?" != "0" ]; then - "publish failed" + echo "publish failed" exit 1 fi popd From 50c6fc9a3b71ea58d10123ebc1e716b9dcae6f0a Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 21 Nov 2012 14:47:47 -0500 Subject: [PATCH 069/142] remove defaults from users/bands, add not null to location fields --- manifest | 1 + up/update_user_band_fields.sql | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 up/update_user_band_fields.sql diff --git a/manifest b/manifest index c9ec13226..467c269a3 100644 --- a/manifest +++ b/manifest @@ -21,3 +21,4 @@ user_authorizations.sql music_session_all_params.sql as_musician.sql bootstrap_users_v3.sql +update_user_band_fields.sql \ No newline at end of file diff --git a/up/update_user_band_fields.sql b/up/update_user_band_fields.sql new file mode 100644 index 000000000..a7899817f --- /dev/null +++ b/up/update_user_band_fields.sql @@ -0,0 +1,23 @@ +alter table users alter column city drop default; +alter table users alter column first_name drop default; +alter table users alter column last_name drop default; +alter table users alter column birth_date drop default; +alter table users alter column birth_date drop not null; + +update users set state = 'NC'; +alter table users alter column state set not null; + +update users set country = 'USA'; +alter table users alter column country set not null; + +alter table bands alter column city drop default; + +update users set state = 'NC'; +alter table bands alter column state set not null; + +update users set country = 'USA'; +alter table bands alter column country set not null; + +--alter table users drop column account_id; + +--drop table accounts; \ No newline at end of file From b751ad7caf7af59d09e604201b81fd9dd17994d3 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 22 Nov 2012 03:25:59 -0500 Subject: [PATCH 070/142] VRFS-81, added creator and updater ID fields to recording table --- manifest | 3 ++- up/add_recording_creator_id.sql | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 up/add_recording_creator_id.sql diff --git a/manifest b/manifest index 467c269a3..6ae6dd162 100644 --- a/manifest +++ b/manifest @@ -21,4 +21,5 @@ user_authorizations.sql music_session_all_params.sql as_musician.sql bootstrap_users_v3.sql -update_user_band_fields.sql \ No newline at end of file +update_user_band_fields.sql +add_recording_creator_id.sql \ No newline at end of file diff --git a/up/add_recording_creator_id.sql b/up/add_recording_creator_id.sql new file mode 100644 index 000000000..5322e463a --- /dev/null +++ b/up/add_recording_creator_id.sql @@ -0,0 +1,2 @@ +ALTER TABLE recordings ADD COLUMN creator_id VARCHAR(64) NOT NULL REFERENCES users (id); +ALTER TABLE recordings ADD COLUMN updater_id VARCHAR(64) NOT NULL REFERENCES users (id); From b635d3799c38aa55e8293a8ad4e606c466d6bad9 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 22 Nov 2012 03:54:42 -0500 Subject: [PATCH 071/142] remove not null constraints on location data --- manifest | 3 ++- up/make_location_nullable.sql | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 up/make_location_nullable.sql diff --git a/manifest b/manifest index 6ae6dd162..4343951f5 100644 --- a/manifest +++ b/manifest @@ -22,4 +22,5 @@ music_session_all_params.sql as_musician.sql bootstrap_users_v3.sql update_user_band_fields.sql -add_recording_creator_id.sql \ No newline at end of file +add_recording_creator_id.sql +make_location_nullable.sql \ No newline at end of file diff --git a/up/make_location_nullable.sql b/up/make_location_nullable.sql new file mode 100644 index 000000000..1bd8e455c --- /dev/null +++ b/up/make_location_nullable.sql @@ -0,0 +1,7 @@ +alter table users alter column city drop not null; +alter table users alter column state drop not null; +alter table users alter column country drop not null; + +alter table bands alter column city drop not null; +alter table bands alter column state drop not null; +alter table bands alter column country drop not null; \ No newline at end of file From ad14343c527a727b69f67cb3b75237eab7578537 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 24 Nov 2012 13:22:16 -0500 Subject: [PATCH 072/142] VRFS-82 band invitation development --- manifest | 3 ++- up/band_invitations.sql | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 up/band_invitations.sql diff --git a/manifest b/manifest index 4343951f5..f83c244c0 100644 --- a/manifest +++ b/manifest @@ -23,4 +23,5 @@ as_musician.sql bootstrap_users_v3.sql update_user_band_fields.sql add_recording_creator_id.sql -make_location_nullable.sql \ No newline at end of file +make_location_nullable.sql +band_invitations.sql \ No newline at end of file diff --git a/up/band_invitations.sql b/up/band_invitations.sql new file mode 100644 index 000000000..ff135bcaf --- /dev/null +++ b/up/band_invitations.sql @@ -0,0 +1,9 @@ +CREATE TABLE band_invitations ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + accepted BOOLEAN, + creator_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file From 98ba28da2ac5b8e2e3113758f31733684f933cf3 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 28 Nov 2012 00:25:09 -0500 Subject: [PATCH 073/142] VRFS 79 add image URL fields to users and bands tables --- manifest | 3 ++- up/image_urls.sql | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 up/image_urls.sql diff --git a/manifest b/manifest index f83c244c0..b86075de7 100644 --- a/manifest +++ b/manifest @@ -24,4 +24,5 @@ bootstrap_users_v3.sql update_user_band_fields.sql add_recording_creator_id.sql make_location_nullable.sql -band_invitations.sql \ No newline at end of file +band_invitations.sql +image_urls.sql \ No newline at end of file diff --git a/up/image_urls.sql b/up/image_urls.sql new file mode 100644 index 000000000..58bc69067 --- /dev/null +++ b/up/image_urls.sql @@ -0,0 +1,3 @@ +alter table users add column photo_url varchar(2048); +alter table bands add column photo_url varchar(2048); +alter table bands add column logo_url varchar(2048); \ No newline at end of file From c9c7db941a45da13ee68e6bb015d586bad9ad4a0 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Thu, 29 Nov 2012 01:27:55 -0800 Subject: [PATCH 074/142] added storage for maxmind data --- manifest | 3 ++- up/max_mind.sql | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 up/max_mind.sql diff --git a/manifest b/manifest index b86075de7..a1ea78d8d 100644 --- a/manifest +++ b/manifest @@ -25,4 +25,5 @@ update_user_band_fields.sql add_recording_creator_id.sql make_location_nullable.sql band_invitations.sql -image_urls.sql \ No newline at end of file +image_urls.sql +max_mind.sql \ No newline at end of file diff --git a/up/max_mind.sql b/up/max_mind.sql new file mode 100644 index 000000000..4bbcc2121 --- /dev/null +++ b/up/max_mind.sql @@ -0,0 +1,12 @@ +CREATE TABLE max_mind ( + ip_bottom INTEGER, + ip_top INTEGER, + country VARCHAR(64), + region VARCHAR(64), + city VARCHAR(255) +); + +CREATE INDEX max_mind_ip_bottom_idx ON max_mind(ip_bottom); +CREATE INDEX max_mind_ip_top_idx ON max_mind(ip_top); + + From e8c334ce0c5e06917bb0f9bd53365f5419d0e22b Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 30 Nov 2012 09:12:01 -0600 Subject: [PATCH 075/142] *VRFS-98 - completed --- manifest | 1 + up/join_request.sql | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 up/join_request.sql diff --git a/manifest b/manifest index c9ec13226..dc53d1563 100644 --- a/manifest +++ b/manifest @@ -21,3 +21,4 @@ user_authorizations.sql music_session_all_params.sql as_musician.sql bootstrap_users_v3.sql +join_request.sql diff --git a/up/join_request.sql b/up/join_request.sql new file mode 100644 index 000000000..fdc5f65ca --- /dev/null +++ b/up/join_request.sql @@ -0,0 +1,12 @@ +CREATE TABLE join_requests ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + music_session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE, + text VARCHAR(2000), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE join_requests ADD CONSTRAINT user_music_session_uniqkey UNIQUE (user_id, music_session_id); + +ALTER TABLE invitations ADD COLUMN join_request_id VARCHAR(64) REFERENCES join_requests(id) ON DELETE CASCADE; From 183089b1044667e54e7fd322390c085b9929063e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 2 Dec 2012 00:38:35 -0500 Subject: [PATCH 076/142] VRFS-117 - added recording genre support --- manifest | 3 ++- up/recordings_genres.sql | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 up/recordings_genres.sql diff --git a/manifest b/manifest index a1ea78d8d..98ba32e22 100644 --- a/manifest +++ b/manifest @@ -26,4 +26,5 @@ add_recording_creator_id.sql make_location_nullable.sql band_invitations.sql image_urls.sql -max_mind.sql \ No newline at end of file +max_mind.sql +recordings_genres.sql \ No newline at end of file diff --git a/up/recordings_genres.sql b/up/recordings_genres.sql new file mode 100644 index 000000000..becc7d5f9 --- /dev/null +++ b/up/recordings_genres.sql @@ -0,0 +1,7 @@ +-- recording -> genre mapping +CREATE TABLE recordings_genres ( + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + genre_id VARCHAR(64) NOT NULL REFERENCES genres(id) ON DELETE CASCADE +); + +ALTER TABLE recordings_genres ADD CONSTRAINT recording_genre_uniqkey UNIQUE (recording_id, genre_id); \ No newline at end of file From 5e380287184c5f452914bcde03b9388810ee1e16 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Sat, 1 Dec 2012 22:37:26 -0800 Subject: [PATCH 077/142] Lengthen the state field for maxmind --- manifest | 1 + up/user_state_lengthen.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/user_state_lengthen.sql diff --git a/manifest b/manifest index 57a9c54c8..7f8674b4c 100644 --- a/manifest +++ b/manifest @@ -28,3 +28,4 @@ band_invitations.sql image_urls.sql max_mind.sql join_request.sql +user_state_lengthen.sql diff --git a/up/user_state_lengthen.sql b/up/user_state_lengthen.sql new file mode 100644 index 000000000..e01be646f --- /dev/null +++ b/up/user_state_lengthen.sql @@ -0,0 +1 @@ +ALTER TABLE users ALTER COLUMN state TYPE VARCHAR(100); From 9da81f76281cd5356d97b0152902460b5419b806 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 3 Dec 2012 22:37:24 -0500 Subject: [PATCH 078/142] VRFS-102 - added tables for likes, comments, etc. --- manifest | 4 ++++ up/comments.sql | 19 +++++++++++++++++++ up/downloads.sql | 8 ++++++++ up/likes.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ up/plays.sql | 17 +++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 up/comments.sql create mode 100644 up/downloads.sql create mode 100644 up/likes.sql create mode 100644 up/plays.sql diff --git a/manifest b/manifest index b874ea7c7..95ddb1c66 100644 --- a/manifest +++ b/manifest @@ -30,3 +30,7 @@ max_mind.sql recordings_genres.sql join_request.sql user_state_lengthen.sql +likes.sql +comments.sql +downloads.sql +plays.sql \ No newline at end of file diff --git a/up/comments.sql b/up/comments.sql new file mode 100644 index 000000000..28520ac57 --- /dev/null +++ b/up/comments.sql @@ -0,0 +1,19 @@ +-- recordings +CREATE TABLE recordings_comments( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + creator_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + comment VARCHAR(4000) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- sessions +CREATE TABLE music_sessions_comments ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + music_session_id VARCHAR(64) NOT NULL REFERENCES music_sessions(id) ON DELETE CASCADE, + creator_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + comment VARCHAR(4000) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/up/downloads.sql b/up/downloads.sql new file mode 100644 index 000000000..049c0feb3 --- /dev/null +++ b/up/downloads.sql @@ -0,0 +1,8 @@ +-- downloads +CREATE TABLE recordings_downloads( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + downloader_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/up/likes.sql b/up/likes.sql new file mode 100644 index 000000000..054fea454 --- /dev/null +++ b/up/likes.sql @@ -0,0 +1,43 @@ +-- musicians +CREATE TABLE users_likers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + liker_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE users_likers ADD CONSTRAINT user_liker_uniqkey UNIQUE (user_id, liker_id); + +-- bands +CREATE TABLE bands_likers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + band_id VARCHAR(64) NOT NULL REFERENCES bands(id) ON DELETE CASCADE, + liker_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE bands_likers ADD CONSTRAINT band_liker_uniqkey UNIQUE (band_id, liker_id); + +-- recordings +CREATE TABLE recordings_likers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + liker_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE recordings_likers ADD CONSTRAINT recording_liker_uniqkey UNIQUE (recording_id, liker_id); + +-- sessions +CREATE TABLE music_sessions_likers ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + music_session_id VARCHAR(64) NOT NULL REFERENCES music_sessions(id) ON DELETE CASCADE, + liker_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE music_sessions_likers ADD CONSTRAINT music_sessions_liker_uniqkey UNIQUE (music_session_id, liker_id); \ No newline at end of file diff --git a/up/plays.sql b/up/plays.sql new file mode 100644 index 000000000..52f91ef06 --- /dev/null +++ b/up/plays.sql @@ -0,0 +1,17 @@ +-- recordings +CREATE TABLE recordings_plays( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + player_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- sessions +CREATE TABLE sessions_plays ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + music_session_id VARCHAR(64) NOT NULL REFERENCES music_sessions(id) ON DELETE CASCADE, + player_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file From 22fce57c97fc33c069f36c918b9fb2a965f37491 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 6 Dec 2012 06:47:36 -0600 Subject: [PATCH 079/142] * p327 --- .rvmrc | 2 +- Gemfile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rvmrc b/.rvmrc index af54c123e..39e913830 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm use ruby-1.9.3-p194@jam-db --create +rvm use ruby-1.9.3-p327@jam-db --create diff --git a/Gemfile b/Gemfile index 3a00ca934..b909eb96e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ -#ruby=1.9.3 source 'https://rubygems.org' # Look for $WORKSPACE, otherwise use "workspace" as dev path. From 43c11d97fc57b653b55cdacb0fdade9b761ecc03 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 8 Dec 2012 23:01:28 -0500 Subject: [PATCH 080/142] VRFS-33 added session settings --- manifest | 3 ++- up/session_settings.sql | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 up/session_settings.sql diff --git a/manifest b/manifest index 95ddb1c66..52984f45f 100644 --- a/manifest +++ b/manifest @@ -33,4 +33,5 @@ user_state_lengthen.sql likes.sql comments.sql downloads.sql -plays.sql \ No newline at end of file +plays.sql +session_settings.sql \ No newline at end of file diff --git a/up/session_settings.sql b/up/session_settings.sql new file mode 100644 index 000000000..65f72bbe6 --- /dev/null +++ b/up/session_settings.sql @@ -0,0 +1 @@ +alter table users add column session_settings varchar(4000); \ No newline at end of file From 2889ad739c662bb15f4736db5d388668bf85fa67 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 9 Dec 2012 15:00:28 -0600 Subject: [PATCH 081/142] * VRFS-149 --- manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest b/manifest index 95ddb1c66..80c80493c 100644 --- a/manifest +++ b/manifest @@ -33,4 +33,4 @@ user_state_lengthen.sql likes.sql comments.sql downloads.sql -plays.sql \ No newline at end of file +plays.sql From 9357d3f03a813762f1b9f3f6b530038aee2c331e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 15 Dec 2012 02:10:01 -0500 Subject: [PATCH 082/142] VRFS-157 track API development --- manifest | 3 ++- up/tracks_rename.sql | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 up/tracks_rename.sql diff --git a/manifest b/manifest index 52984f45f..32c82541f 100644 --- a/manifest +++ b/manifest @@ -34,4 +34,5 @@ likes.sql comments.sql downloads.sql plays.sql -session_settings.sql \ No newline at end of file +session_settings.sql +tracks_rename.sql \ No newline at end of file diff --git a/up/tracks_rename.sql b/up/tracks_rename.sql new file mode 100644 index 000000000..3b072f596 --- /dev/null +++ b/up/tracks_rename.sql @@ -0,0 +1 @@ +alter table connections_tracks rename to tracks; \ No newline at end of file From a8a59abdd59b91b90f131fd8b3694346a688e862 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Fri, 21 Dec 2012 11:50:21 -0800 Subject: [PATCH 083/142] Reset password schema --- manifest | 3 ++- up/reset_password.sql | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 up/reset_password.sql diff --git a/manifest b/manifest index 32c82541f..273951c6c 100644 --- a/manifest +++ b/manifest @@ -35,4 +35,5 @@ comments.sql downloads.sql plays.sql session_settings.sql -tracks_rename.sql \ No newline at end of file +tracks_rename.sql +reset_password.sql diff --git a/up/reset_password.sql b/up/reset_password.sql new file mode 100644 index 000000000..f29234486 --- /dev/null +++ b/up/reset_password.sql @@ -0,0 +1,3 @@ +-- Add columns for handling password resets. +ALTER TABLE users ADD COLUMN reset_token VARCHAR(64); +ALTER TABLE users ADD COLUMN reset_token_created DATE; From cb625d17abc9b64c042a9bc3d55951701bca9216 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Fri, 21 Dec 2012 11:51:25 -0800 Subject: [PATCH 084/142] make naming clearer --- up/reset_password.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/up/reset_password.sql b/up/reset_password.sql index f29234486..ce346983a 100644 --- a/up/reset_password.sql +++ b/up/reset_password.sql @@ -1,3 +1,3 @@ -- Add columns for handling password resets. -ALTER TABLE users ADD COLUMN reset_token VARCHAR(64); -ALTER TABLE users ADD COLUMN reset_token_created DATE; +ALTER TABLE users ADD COLUMN reset_password_token VARCHAR(64); +ALTER TABLE users ADD COLUMN reset_password_token_created DATE; From 93a02251ad5215492d6e1f0bb890797acb1ee308 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Fri, 21 Dec 2012 12:01:47 -0800 Subject: [PATCH 085/142] switch to timestamp --- up/reset_password.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/reset_password.sql b/up/reset_password.sql index ce346983a..cf5de9950 100644 --- a/up/reset_password.sql +++ b/up/reset_password.sql @@ -1,3 +1,3 @@ -- Add columns for handling password resets. ALTER TABLE users ADD COLUMN reset_password_token VARCHAR(64); -ALTER TABLE users ADD COLUMN reset_password_token_created DATE; +ALTER TABLE users ADD COLUMN reset_password_token_created TIMESTAMP; From fe6680a7d929cd17d0abc944312d671b48aa4098 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 29 Dec 2012 09:28:19 -0500 Subject: [PATCH 086/142] VRFS-159 block, spam, ignore friend requests / unit tests --- manifest | 1 + up/friend_request_changes.sql | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 up/friend_request_changes.sql diff --git a/manifest b/manifest index 273951c6c..43d2d742b 100644 --- a/manifest +++ b/manifest @@ -37,3 +37,4 @@ plays.sql session_settings.sql tracks_rename.sql reset_password.sql +friend_request_changes.sql \ No newline at end of file diff --git a/up/friend_request_changes.sql b/up/friend_request_changes.sql new file mode 100644 index 000000000..92128b6ff --- /dev/null +++ b/up/friend_request_changes.sql @@ -0,0 +1,3 @@ +alter table friend_requests drop column accepted; +alter table friend_requests add column status varchar(50); +alter table friend_requests add column message varchar(4000); \ No newline at end of file From 2550fb40b52014dfbd4bf1a4f72d656a8637ebbf Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 30 Dec 2012 09:34:15 -0500 Subject: [PATCH 087/142] remove friend_requests constraint to allow friend requests with same source/target users --- up/friend_request_changes.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/up/friend_request_changes.sql b/up/friend_request_changes.sql index 92128b6ff..a11a09d18 100644 --- a/up/friend_request_changes.sql +++ b/up/friend_request_changes.sql @@ -1,3 +1,4 @@ alter table friend_requests drop column accepted; alter table friend_requests add column status varchar(50); -alter table friend_requests add column message varchar(4000); \ No newline at end of file +alter table friend_requests add column message varchar(4000); +alter table friend_requests drop constraint user_friend_request_uniqkey; \ No newline at end of file From 515e1c2b7a51813bfd70301fc48fce6cd4279294 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Fri, 4 Jan 2013 03:57:54 -0600 Subject: [PATCH 088/142] VRFS-194: added can_invite column to users --- manifest | 3 ++- up/user_add_can_invite.sql | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 up/user_add_can_invite.sql diff --git a/manifest b/manifest index 43d2d742b..4cbd74f88 100644 --- a/manifest +++ b/manifest @@ -37,4 +37,5 @@ plays.sql session_settings.sql tracks_rename.sql reset_password.sql -friend_request_changes.sql \ No newline at end of file +friend_request_changes.sql +user_add_can_invite.sql diff --git a/up/user_add_can_invite.sql b/up/user_add_can_invite.sql new file mode 100644 index 000000000..3fa3c9af4 --- /dev/null +++ b/up/user_add_can_invite.sql @@ -0,0 +1,2 @@ +-- add can_invite flag to users; for beta retrict +ALTER TABLE users ADD COLUMN can_invite BOOLEAN NOT NULL DEFAULT true; From 8148e70e2b805bcbf7229304d94e774bfd7c6e28 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Fri, 4 Jan 2013 12:04:09 -0600 Subject: [PATCH 089/142] VRFS-193: adding admin_users via activeadmin gem --- manifest | 1 + up/admin_users.sql | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 up/admin_users.sql diff --git a/manifest b/manifest index 3faf80e19..ece2cd330 100644 --- a/manifest +++ b/manifest @@ -40,3 +40,4 @@ reset_password.sql friend_request_changes.sql session_history.sql user_add_can_invite.sql +admin_users.sql diff --git a/up/admin_users.sql b/up/admin_users.sql new file mode 100644 index 000000000..8933ceaeb --- /dev/null +++ b/up/admin_users.sql @@ -0,0 +1,68 @@ + +CREATE TABLE admin_users ( + id integer NOT NULL, + email character varying(255) DEFAULT ''::character varying NOT NULL, + encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL, + reset_password_token character varying(255), + reset_password_sent_at timestamp without time zone, + remember_created_at timestamp without time zone, + sign_in_count integer DEFAULT 0, + current_sign_in_at timestamp without time zone, + last_sign_in_at timestamp without time zone, + current_sign_in_ip character varying(255), + last_sign_in_ip character varying(255), + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +ALTER TABLE public.admin_users OWNER TO postgres; +CREATE SEQUENCE admin_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE public.admin_users_id_seq OWNER TO postgres; +ALTER SEQUENCE admin_users_id_seq OWNED BY admin_users.id; +SELECT pg_catalog.setval('admin_users_id_seq', 2, true); +ALTER TABLE ONLY admin_users ALTER COLUMN id SET DEFAULT nextval('admin_users_id_seq'::regclass); +ALTER TABLE ONLY admin_users + ADD CONSTRAINT admin_users_pkey PRIMARY KEY (id); +CREATE UNIQUE INDEX index_admin_users_on_email ON admin_users USING btree (email); +CREATE UNIQUE INDEX index_admin_users_on_reset_password_token ON admin_users USING btree (reset_password_token); + +--------------------------------- + +CREATE TABLE active_admin_comments ( + id integer NOT NULL, + resource_id character varying(255) NOT NULL, + resource_type character varying(255) NOT NULL, + author_id integer, + author_type character varying(255), + body text, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + namespace character varying(255) +); +ALTER TABLE public.active_admin_comments OWNER TO postgres; +CREATE SEQUENCE active_admin_comments_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER TABLE public.active_admin_comments_id_seq OWNER TO postgres; +ALTER SEQUENCE active_admin_comments_id_seq OWNED BY active_admin_comments.id; +SELECT pg_catalog.setval('active_admin_comments_id_seq', 1, false); +ALTER TABLE ONLY active_admin_comments ALTER COLUMN id SET DEFAULT nextval('active_admin_comments_id_seq'::regclass); +ALTER TABLE ONLY active_admin_comments + ADD CONSTRAINT admin_comments_pkey PRIMARY KEY (id); +CREATE INDEX index_active_admin_comments_on_author_type_and_author_id ON active_admin_comments USING btree (author_type, author_id); +CREATE INDEX index_active_admin_comments_on_namespace ON active_admin_comments USING btree (namespace); +CREATE INDEX index_admin_comments_on_resource_type_and_resource_id ON active_admin_comments USING btree (resource_type, resource_id); + + +--------------------------------- + From a9f6b03af3f6fae4b7a8398a7f27ba59776d5fc4 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 6 Jan 2013 15:46:22 -0500 Subject: [PATCH 090/142] VRFS-80 session history --- manifest | 3 ++- up/session_history.sql | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 up/session_history.sql diff --git a/manifest b/manifest index 43d2d742b..ebaf3ff90 100644 --- a/manifest +++ b/manifest @@ -37,4 +37,5 @@ plays.sql session_settings.sql tracks_rename.sql reset_password.sql -friend_request_changes.sql \ No newline at end of file +friend_request_changes.sql +session_history.sql \ No newline at end of file diff --git a/up/session_history.sql b/up/session_history.sql new file mode 100644 index 000000000..d195ae90b --- /dev/null +++ b/up/session_history.sql @@ -0,0 +1,20 @@ +CREATE TABLE music_sessions_history ( + id character varying(64) NOT NULL DEFAULT uuid_generate_v4(), + music_session_id varchar(64) NOT NULL, + description character varying(8000), + user_id character varying(64) NOT NULL references users(id), + band_id character varying(64) references bands(id) on delete cascade, + genres VARCHAR(255), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + session_removed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE music_sessions_history ADD CONSTRAINT music_session_uniqkey UNIQUE (music_session_id); + +CREATE TABLE music_sessions_user_history ( + id character varying(64) NOT NULL DEFAULT uuid_generate_v4(), + music_session_id varchar(64) NOT NULL references music_sessions_history(music_session_id), + user_id character varying(64) NOT NULL references users(id), + client_id character varying(64) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From c5ebe4fee715fe355d4e27e499981f85e8afbd61 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 13 Jan 2013 22:47:17 -0600 Subject: [PATCH 091/142] * VRFS-217: creating the necessary migration for full text search --- manifest | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest b/manifest index ece2cd330..45c3a8243 100644 --- a/manifest +++ b/manifest @@ -41,3 +41,4 @@ friend_request_changes.sql session_history.sql user_add_can_invite.sql admin_users.sql +full_text_search.sql From 99e18d41b42d6c63841899450633c6c3a2da326a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 13 Jan 2013 23:04:11 -0600 Subject: [PATCH 092/142] * VRFS-217 forgot migration file --- up/full_text_search.sql | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 up/full_text_search.sql diff --git a/up/full_text_search.sql b/up/full_text_search.sql new file mode 100644 index 000000000..79ef32a94 --- /dev/null +++ b/up/full_text_search.sql @@ -0,0 +1,46 @@ + +-- as a result of these migrations, you can do the following: + +-- find a band with a word starting with 'Par' +-- select name from bands where name_tsv @@ to_tsquery('jamenglish', 'Par:*'); +-- find a user with first or last name starting with 'Cal' +-- select first_name FROM users where name_tsv @@ to_tsquery('jamenglish', 'Cal:*'); +-- find a recording with descriptio start with 'Fu' +-- select description FROM descriptions where description_tsv @@ to_tsquery('jamenglish', 'Fu:*'); + +CREATE TEXT SEARCH DICTIONARY english_stem ( + TEMPLATE = snowball, + Language = english, + StopWords = english); + +-- create a new configuration based on the standard 'english' configuration +CREATE TEXT SEARCH CONFIGURATION public.jamenglish ( COPY = pg_catalog.english ); +-- use snowball for word-y things +ALTER TEXT SEARCH CONFIGURATION public.jamenglish ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, + word, hword, hword_part WITH english_stem; +-- don't worry about parsing character junk +ALTER TEXT SEARCH CONFIGURATION public.jamenglish DROP MAPPING FOR email, url, url_path, sfloat, float; + +-- add relevant rows to users, bands, recordings +ALTER TABLE users ADD COLUMN name_tsv tsvector; +CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE +ON users FOR EACH ROW EXECUTE PROCEDURE +tsvector_update_trigger(name_tsv, 'public.jamenglish', first_name, last_name); +CREATE INDEX users_name_tsv_index ON users USING gin(name_tsv); + +ALTER TABLE bands ADD COLUMN name_tsv tsvector; +CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE +ON bands FOR EACH ROW EXECUTE PROCEDURE +tsvector_update_trigger(name_tsv, 'public.jamenglish', name); +CREATE INDEX bands_name_tsv_index ON bands USING gin(name_tsv); + +ALTER TABLE recordings ADD COLUMN description_tsv tsvector; +CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE +ON recordings FOR EACH ROW EXECUTE PROCEDURE +tsvector_update_trigger(description_tsv, 'public.jamenglish', description); +CREATE INDEX recordings_description_tsv_index ON recordings USING gin(description_tsv); + +-- update all existing data to invoke triggers +update users set first_name=first_name, last_name=last_name; +update bands set name=name; +update recordings set description=description; From cc37a1cf5ff1b2c60c56811253e2265b39cd94a3 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Mon, 14 Jan 2013 18:14:08 -0800 Subject: [PATCH 093/142] added migration --- manifest | 1 + up/saved_tracks.sql | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 up/saved_tracks.sql diff --git a/manifest b/manifest index 45c3a8243..f18b3ff10 100644 --- a/manifest +++ b/manifest @@ -42,3 +42,4 @@ session_history.sql user_add_can_invite.sql admin_users.sql full_text_search.sql +saved_tracks.sql diff --git a/up/saved_tracks.sql b/up/saved_tracks.sql new file mode 100644 index 000000000..c91ca5002 --- /dev/null +++ b/up/saved_tracks.sql @@ -0,0 +1,11 @@ +CREATE TABLE saved_tracks ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + sound VARCHAR(64) NOT NULL, + next_part_to_upload INTEGER NOT NULL DEFAULT 0, + fully_uploaded BOOLEAN NOT NULL DEFAULT FALSE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + From aee1bddfe4f88f64dcc3cf002f989e4334ccd392 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Wed, 16 Jan 2013 16:37:09 -0800 Subject: [PATCH 094/142] Added the upload id column --- manifest | 1 + up/saved_tracks_upload_id.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/saved_tracks_upload_id.sql diff --git a/manifest b/manifest index f18b3ff10..3ad5aacf6 100644 --- a/manifest +++ b/manifest @@ -43,3 +43,4 @@ user_add_can_invite.sql admin_users.sql full_text_search.sql saved_tracks.sql +saved_tracks_upload_id.sql diff --git a/up/saved_tracks_upload_id.sql b/up/saved_tracks_upload_id.sql new file mode 100644 index 000000000..5121c63b2 --- /dev/null +++ b/up/saved_tracks_upload_id.sql @@ -0,0 +1 @@ +ALTER TABLE saved_tracks ADD COLUMN upload_id VARCHAR(64); From 2e4b9d1e46c4beb54eda98a103e2e57f29335cb6 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 22 Jan 2013 02:36:24 +0000 Subject: [PATCH 095/142] *VRFS-277 jam-db package for debian --- Gemfile | 3 +-- Gemfile.lock | 1 - build | 8 ++++++++ jenkins | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index b909eb96e..875a3fee6 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,4 @@ workspace = ENV["WORKSPACE"] || "~/workspace" # Assumes you have already cloned pg_migrate_ruby in your workspace # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby - -gem 'pg_migrate', '0.1.6' # :path=> "#{workspace}/pg_migrate_ruby" +gem 'pg_migrate', '0.1.6' diff --git a/Gemfile.lock b/Gemfile.lock index 7f2d466c8..649146a02 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,6 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) - pg (0.14.0-x86-mingw32) pg_migrate (0.1.6) logging (= 1.7.2) pg (= 0.14.0) diff --git a/build b/build index 9fc4ec1ab..dd8ed30e7 100755 --- a/build +++ b/build @@ -26,3 +26,11 @@ bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$VERSION" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $VERSION + +if [ ! -z "PACKAGE" ]; then + bundle install --path target/vendor/bundle + pushd target + fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem + find vendor/bundle/ruby/1.9.1/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb + popd +fi diff --git a/jenkins b/jenkins index b80360438..8ccb13fb5 100755 --- a/jenkins +++ b/jenkins @@ -1,6 +1,7 @@ #!/bin/bash GEM_SERVER=http://localhost:9000/gems +DEB_SERVER=http://localhost:9010/apt-i386 echo "starting build..." ./build @@ -17,6 +18,24 @@ if [ "$?" = "0" ]; then fi popd echo "done publishing gems" + + if [ ! -z "$PACKAGE" ]; then + echo "publishing ubuntu packages (.deb)" + for f in `find target -name '*.deb'`; do + DEBNAME=`basename $f` + DEBPATH="$f" + echo "publishing $DEBPATH to deb server" + curl -f -T $DEBPATH $DEB_SERVER/$DEBNAME + + if [ "$?" != "0" ]; then + echo "deb publish failed of $DEBPATH" + exit 1 + fi + done + + echo "done publishing debs" + fi + else echo "build failed" exit 1 From 402fda6e8c65066b3ffb0aebf6660043bc2502bb Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 22 Jan 2013 11:14:34 -0800 Subject: [PATCH 096/142] more wokr --- manifest | 1 + up/recorded_tracks.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 up/recorded_tracks.sql diff --git a/manifest b/manifest index 3ad5aacf6..77684cc61 100644 --- a/manifest +++ b/manifest @@ -44,3 +44,4 @@ admin_users.sql full_text_search.sql saved_tracks.sql saved_tracks_upload_id.sql +recorded_tracks.sql diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql new file mode 100644 index 000000000..def3fa32e --- /dev/null +++ b/up/recorded_tracks.sql @@ -0,0 +1,8 @@ +ALTER TABLE saved_tracks RENAME TO recorded_tracks; +ALTER TABLE recorded_tracks ADD COLUMN recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE + +DROP TABLE bands_recordings; + +ALTER TABLE music_sessions ADD COLUMN recording BOOLEAN NOT NULL DEFAULT false; + + From 3ac9ef0c2a4c5585009a6fa5c541b721b096d80e Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 22 Jan 2013 14:04:12 -0800 Subject: [PATCH 097/142] more work --- up/recorded_tracks.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql index def3fa32e..b1861ca58 100644 --- a/up/recorded_tracks.sql +++ b/up/recorded_tracks.sql @@ -1,8 +1,12 @@ ALTER TABLE saved_tracks RENAME TO recorded_tracks; -ALTER TABLE recorded_tracks ADD COLUMN recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE +ALTER TABLE recorded_tracks ADD COLUMN recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE; DROP TABLE bands_recordings; ALTER TABLE music_sessions ADD COLUMN recording BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE musicians_recordings RENAME TO recordings_users; + +ALTER TABLE recordings RENAME COLUMN creator_id TO owner_id; +ALTER TABLE recordings DROP COLUMN updater_id; From 1befcade8d5065bd74b42321167a49dac4f82824 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Wed, 23 Jan 2013 17:48:36 -0800 Subject: [PATCH 098/142] more work --- up/recorded_tracks.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql index b1861ca58..937451b96 100644 --- a/up/recorded_tracks.sql +++ b/up/recorded_tracks.sql @@ -9,4 +9,5 @@ ALTER TABLE musicians_recordings RENAME TO recordings_users; ALTER TABLE recordings RENAME COLUMN creator_id TO owner_id; ALTER TABLE recordings DROP COLUMN updater_id; +ALTER TABLE recordings ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); From 68d346496b518e01fc2de170b9eab48b5e1f68ac Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 26 Jan 2013 19:23:26 -0600 Subject: [PATCH 099/142] * oops. meant to make fpm optional but messed up the check for $PACKAGE --- Gemfile.lock | 1 + build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 649146a02..7f2d466c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,7 @@ GEM logging (1.7.2) little-plugger (>= 1.1.3) pg (0.14.0) + pg (0.14.0-x86-mingw32) pg_migrate (0.1.6) logging (= 1.7.2) pg (= 0.14.0) diff --git a/build b/build index dd8ed30e7..d4dd5ea48 100755 --- a/build +++ b/build @@ -27,7 +27,7 @@ bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$VERSION" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $VERSION -if [ ! -z "PACKAGE" ]; then +if [ ! -z "$PACKAGE" ]; then bundle install --path target/vendor/bundle pushd target fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem From 2c9dfed0ff04f00d0fa12eff2682cb5212e1b84c Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 26 Jan 2013 19:24:20 -0600 Subject: [PATCH 100/142] * fixing up gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f2572c3ce..e2983ef18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ target *~ *.swp - +vendor +*.deb +.bundle From 1d498fad80716a6952ae150334ff8347fd2aac66 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 29 Jan 2013 21:46:16 -0800 Subject: [PATCH 101/142] more work --- up/recorded_tracks.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql index 937451b96..2cacfbf96 100644 --- a/up/recorded_tracks.sql +++ b/up/recorded_tracks.sql @@ -3,11 +3,11 @@ ALTER TABLE recorded_tracks ADD COLUMN recording_id VARCHAR(64) NOT NULL REFEREN DROP TABLE bands_recordings; -ALTER TABLE music_sessions ADD COLUMN recording BOOLEAN NOT NULL DEFAULT false; - ALTER TABLE musicians_recordings RENAME TO recordings_users; ALTER TABLE recordings RENAME COLUMN creator_id TO owner_id; ALTER TABLE recordings DROP COLUMN updater_id; ALTER TABLE recordings ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); +ALTER TABLE recordings ADD COLUMN band_id VARCHAR(64) REFERENCES bands(id); + From 723b52c5bd495c3d96e2113e1a509be2f0691827 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Thu, 31 Jan 2013 00:24:39 -0800 Subject: [PATCH 102/142] more work --- up/recorded_tracks.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql index 2cacfbf96..549da2fbf 100644 --- a/up/recorded_tracks.sql +++ b/up/recorded_tracks.sql @@ -9,5 +9,8 @@ ALTER TABLE recordings RENAME COLUMN creator_id TO owner_id; ALTER TABLE recordings DROP COLUMN updater_id; ALTER TABLE recordings ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); ALTER TABLE recordings ADD COLUMN band_id VARCHAR(64) REFERENCES bands(id); - +ALTER TABLE recordings ALTER COLUMN description DROP NOT NULL; +ALTER TABLE recordings ADD COLUMN name VARCHAR(100) NOT NULL; +ALTER TABLE recordings ADD COLUMN is_public BOOLEAN; +ALTER TABLE recordings ADD COLUMN is_downloadable BOOLEAN; From 760a2147f8f9fc78f2e02f0acdb95b90051cec69 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Mon, 4 Feb 2013 11:25:54 -0800 Subject: [PATCH 103/142] more work --- up/recorded_tracks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/recorded_tracks.sql b/up/recorded_tracks.sql index 549da2fbf..7d83f61f9 100644 --- a/up/recorded_tracks.sql +++ b/up/recorded_tracks.sql @@ -10,7 +10,7 @@ ALTER TABLE recordings DROP COLUMN updater_id; ALTER TABLE recordings ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id); ALTER TABLE recordings ADD COLUMN band_id VARCHAR(64) REFERENCES bands(id); ALTER TABLE recordings ALTER COLUMN description DROP NOT NULL; -ALTER TABLE recordings ADD COLUMN name VARCHAR(100) NOT NULL; +ALTER TABLE recordings ADD COLUMN name VARCHAR(100); ALTER TABLE recordings ADD COLUMN is_public BOOLEAN; ALTER TABLE recordings ADD COLUMN is_downloadable BOOLEAN; From 452a03294863351423ced8062efafbb455a7eec7 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 5 Feb 2013 23:17:15 -0600 Subject: [PATCH 104/142] * artifact update --- manifest | 1 + up/artifact_update.sql | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 up/artifact_update.sql diff --git a/manifest b/manifest index 3ad5aacf6..13ae90d8a 100644 --- a/manifest +++ b/manifest @@ -44,3 +44,4 @@ admin_users.sql full_text_search.sql saved_tracks.sql saved_tracks_upload_id.sql +artifact_update.sql diff --git a/up/artifact_update.sql b/up/artifact_update.sql new file mode 100644 index 000000000..e4a6ced5d --- /dev/null +++ b/up/artifact_update.sql @@ -0,0 +1,14 @@ +-- artifact 'pointer' table + +CREATE TABLE artifact_updates ( + id character varying(64) NOT NULL DEFAULT uuid_generate_v4(), + product varchar(255) NOT NULL, + version varchar(255) NOT NULL, + uri varchar(2000) NOT NULL, + sha1 varchar(255) NOT NULL, + environment varchar(255) NOT NULL DEFAULT 'public' +); + +ALTER TABLE artifact_updates ADD CONSTRAINT artifact_updates_uniqkey UNIQUE (product, version); + +ALTER TABLE users ADD COLUMN environment varchar(255) NOT NULL DEFAULT 'public'; From 3e9b4515ea7de1a55ca7131785df3315f9760af8 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Wed, 6 Feb 2013 07:07:05 -0600 Subject: [PATCH 105/142] vrfs192: added connection.aasm_state column --- manifest | 1 + up/connection_aasm_state.sql | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 up/connection_aasm_state.sql diff --git a/manifest b/manifest index 3ad5aacf6..56056a55e 100644 --- a/manifest +++ b/manifest @@ -44,3 +44,4 @@ admin_users.sql full_text_search.sql saved_tracks.sql saved_tracks_upload_id.sql +connection_aasm_state.sql diff --git a/up/connection_aasm_state.sql b/up/connection_aasm_state.sql new file mode 100644 index 000000000..dc5f6ed2d --- /dev/null +++ b/up/connection_aasm_state.sql @@ -0,0 +1,2 @@ +-- connection state for supporting aasm gem +ALTER TABLE connections ADD COLUMN aasm_state VARCHAR(64) NOT NULL DEFAULT 'idle'; From 193419227e5dcc790635f6b7dcabf4b2eb569fb5 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 12 Feb 2013 20:00:38 -0600 Subject: [PATCH 106/142] * sha1 no longer requried --- manifest | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest b/manifest index 13ae90d8a..b16afb41d 100644 --- a/manifest +++ b/manifest @@ -45,3 +45,4 @@ full_text_search.sql saved_tracks.sql saved_tracks_upload_id.sql artifact_update.sql +artifact_update_modified.sql From 69c662398e9a7c9939036c383dd6479a37f890c2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 12 Feb 2013 21:07:19 -0600 Subject: [PATCH 107/142] * putting recorded_tracks.sql at the bottom, commented out --- manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest b/manifest index c22ea20e0..3b596b468 100644 --- a/manifest +++ b/manifest @@ -46,5 +46,5 @@ saved_tracks.sql saved_tracks_upload_id.sql artifact_update.sql connection_aasm_state.sql -recorded_tracks.sql artifact_update_modified.sql +#recorded_tracks.sql From 7075d4c17c01946cd82b1f3d0689d8a1f156835a Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 12 Feb 2013 21:10:26 -0600 Subject: [PATCH 108/142] * ooops; missed adding matching migartion --- up/artifact_update_modified.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 up/artifact_update_modified.sql diff --git a/up/artifact_update_modified.sql b/up/artifact_update_modified.sql new file mode 100644 index 000000000..0d69f0d6d --- /dev/null +++ b/up/artifact_update_modified.sql @@ -0,0 +1 @@ +ALTER TABLE artifact_updates ALTER COLUMN sha1 DROP NOT NULL; From ca8f231a0232522e86bdb6874915bcfc4e33b8ad Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Sat, 16 Feb 2013 01:34:30 -0800 Subject: [PATCH 109/142] put back in recorded_tracks --- manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest b/manifest index 3b596b468..b5ee22de2 100644 --- a/manifest +++ b/manifest @@ -47,4 +47,4 @@ saved_tracks_upload_id.sql artifact_update.sql connection_aasm_state.sql artifact_update_modified.sql -#recorded_tracks.sql +recorded_tracks.sql From 4650c22089a6b094e0876b219c079755e1747249 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 1 Mar 2013 07:35:22 -0600 Subject: [PATCH 110/142] * VRFS-259: allow first/last name to be null in db to aid in adminstrative signup flow --- manifest | 1 + up/allow_null_first_last_name.sql | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 up/allow_null_first_last_name.sql diff --git a/manifest b/manifest index b5ee22de2..ca05f9762 100644 --- a/manifest +++ b/manifest @@ -48,3 +48,4 @@ artifact_update.sql connection_aasm_state.sql artifact_update_modified.sql recorded_tracks.sql +allow_null_first_last_name.sql diff --git a/up/allow_null_first_last_name.sql b/up/allow_null_first_last_name.sql new file mode 100644 index 000000000..02c5c3327 --- /dev/null +++ b/up/allow_null_first_last_name.sql @@ -0,0 +1,6 @@ +-- allow null first names and last names so that administrators can invite users +-- with a minimum of fields filled out +ALTER TABLE users ALTER COLUMN first_name DROP NOT NULL; +ALTER TABLE users ALTER COLUMN last_name DROP NOT NULL; +ALTER TABLE users ALTER COLUMN gender DROP NOT NULL; +ALTER TABLE users ALTER COLUMN gender DROP DEFAULT; From b5028777209e26b837e5ebd7f700d754d7f83dfb Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 14 Mar 2013 23:21:53 -0500 Subject: [PATCH 111/142] * VRFS-259: beta signup --- manifest | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest b/manifest index ca05f9762..50589e577 100644 --- a/manifest +++ b/manifest @@ -49,3 +49,7 @@ connection_aasm_state.sql artifact_update_modified.sql recorded_tracks.sql allow_null_first_last_name.sql +invited_users.sql +collapse_user_and_admin.sql +default_gender_to_null.sql +subscribe_email.sql From 080ba4fef736b4dcf35cf87945250532f5639db2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 14 Mar 2013 23:22:00 -0500 Subject: [PATCH 112/142] * VRFS-259: beta signup --- up/collapse_user_and_admin.sql | 4 ++++ up/default_gender_to_null.sql | 1 + up/invited_users.sql | 12 ++++++++++++ up/subscribe_email.sql | 1 + 4 files changed, 18 insertions(+) create mode 100644 up/collapse_user_and_admin.sql create mode 100644 up/default_gender_to_null.sql create mode 100644 up/invited_users.sql create mode 100644 up/subscribe_email.sql diff --git a/up/collapse_user_and_admin.sql b/up/collapse_user_and_admin.sql new file mode 100644 index 000000000..654fa8777 --- /dev/null +++ b/up/collapse_user_and_admin.sql @@ -0,0 +1,4 @@ +-- make your life easy and use this name for your encrypted password +ALTER TABLE users RENAME COLUMN password_digest TO encrypted_password; + +DROP TABLE admin_users; diff --git a/up/default_gender_to_null.sql b/up/default_gender_to_null.sql new file mode 100644 index 000000000..6c2f1ab35 --- /dev/null +++ b/up/default_gender_to_null.sql @@ -0,0 +1 @@ +ALTER TABLE users ALTER gender DROP DEFAULT; diff --git a/up/invited_users.sql b/up/invited_users.sql new file mode 100644 index 000000000..e691c1903 --- /dev/null +++ b/up/invited_users.sql @@ -0,0 +1,12 @@ +-- a table to manage invitations from one user to another +CREATE TABLE invited_users ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + sender_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + autofriend BOOLEAN NOT NULL, + email VARCHAR(256) NOT NULL, + invitation_code VARCHAR(256) UNIQUE NOT NULL, + accepted BOOLEAN DEFAULT FALSE, + note text, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); diff --git a/up/subscribe_email.sql b/up/subscribe_email.sql new file mode 100644 index 000000000..b97cde88a --- /dev/null +++ b/up/subscribe_email.sql @@ -0,0 +1 @@ +ALTER TABLE users ADD COLUMN subscribe_email BOOLEAN DEFAULT false; From 0364f7561d7b653e4b7f61af27e04fa7fd962b7e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 21 Mar 2013 23:19:35 -0400 Subject: [PATCH 113/142] VRFS-281 added table for persistent notifications --- manifest | 1 + up/notifications.sql | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 up/notifications.sql diff --git a/manifest b/manifest index 50589e577..affb2f241 100644 --- a/manifest +++ b/manifest @@ -53,3 +53,4 @@ invited_users.sql collapse_user_and_admin.sql default_gender_to_null.sql subscribe_email.sql +notifications.sql \ No newline at end of file diff --git a/up/notifications.sql b/up/notifications.sql new file mode 100644 index 000000000..416d0aa7a --- /dev/null +++ b/up/notifications.sql @@ -0,0 +1,13 @@ +CREATE TABLE notifications ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + type VARCHAR(32) NOT NULL, + source_user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + target_user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE, + band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE, + session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE, + recording_id VARCHAR(64) REFERENCES recordings(id) ON DELETE CASCADE, + invitation_id VARCHAR(64) REFERENCES invitations(id) ON DELETE CASCADE, + join_request_id VARCHAR(64) REFERENCES join_requests(id) ON DELETE CASCADE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); \ No newline at end of file From 13282318309ea5c689c55a4af31f1de40100884d Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 4 Apr 2013 23:33:59 -0400 Subject: [PATCH 114/142] VRFS-282 changes to support real-time notification updates in sidebar --- manifest | 3 ++- up/notification_type_col_rename.sql | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 up/notification_type_col_rename.sql diff --git a/manifest b/manifest index affb2f241..360810ba8 100644 --- a/manifest +++ b/manifest @@ -53,4 +53,5 @@ invited_users.sql collapse_user_and_admin.sql default_gender_to_null.sql subscribe_email.sql -notifications.sql \ No newline at end of file +notifications.sql +notification_type_col_rename.sql \ No newline at end of file diff --git a/up/notification_type_col_rename.sql b/up/notification_type_col_rename.sql new file mode 100644 index 000000000..5befa0477 --- /dev/null +++ b/up/notification_type_col_rename.sql @@ -0,0 +1 @@ +alter table notifications rename column type to description; \ No newline at end of file From c46a2c2a2cbc8c7e5411ee9479240712b9726e7b Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 10 Apr 2013 01:13:40 -0500 Subject: [PATCH 115/142] * requiring md5 and size of artifacts so that we can report them in artifact REST API --- manifest | 3 ++- up/artifact_metadata.sql | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 up/artifact_metadata.sql diff --git a/manifest b/manifest index affb2f241..20b88102d 100644 --- a/manifest +++ b/manifest @@ -53,4 +53,5 @@ invited_users.sql collapse_user_and_admin.sql default_gender_to_null.sql subscribe_email.sql -notifications.sql \ No newline at end of file +notifications.sql +artifact_metadata.sql diff --git a/up/artifact_metadata.sql b/up/artifact_metadata.sql new file mode 100644 index 000000000..77905a8d3 --- /dev/null +++ b/up/artifact_metadata.sql @@ -0,0 +1,3 @@ +-- add a size field and make md5 required +ALTER TABLE artifact_updates ADD COLUMN size INTEGER NOT NULL; +ALTER TABLE artifact_updates ALTER COLUMN sha1 SET NOT NULL; From e9137aef38b4ccddc75f1595be6850c09d9786b4 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Fri, 12 Apr 2013 15:34:41 -0700 Subject: [PATCH 116/142] mixes migration --- manifest | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest b/manifest index c50694c9d..0d9cb8d0d 100644 --- a/manifest +++ b/manifest @@ -56,3 +56,4 @@ subscribe_email.sql notifications.sql notification_type_col_rename.sql artifact_metadata.sql +mixes.sql From 481919d1f347ce3f394a516387120815da18e809 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Fri, 12 Apr 2013 15:34:59 -0700 Subject: [PATCH 117/142] add the actual file --- up/mixes.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 up/mixes.sql diff --git a/up/mixes.sql b/up/mixes.sql new file mode 100644 index 000000000..376dc2d30 --- /dev/null +++ b/up/mixes.sql @@ -0,0 +1,18 @@ +-- mixes +CREATE TABLE mixes( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE, + owner_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, + description VARCHAR(1024) NOT NULL, + spec TEXT NOT NULL, + url VARCHAR(512) DEFAULT NULL, + mix_server VARCHAR(64) DEFAULT NULL, + started_at TIMESTAMP DEFAULT NULL, + completed_at TIMESTAMP DEFAULT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE INDEX index_started_at ON mixes USING btree (started_at); +CREATE INDEX index_completed_at ON mixes USING btree (completed_at); + From 22094206b455d9a0e46c8f01ae7f56b4fcbb80bb Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 13 Apr 2013 22:56:19 -0400 Subject: [PATCH 118/142] add friend request id to notifications table --- manifest | 3 ++- up/notifications_add_friend_req_id.sql | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 up/notifications_add_friend_req_id.sql diff --git a/manifest b/manifest index 360810ba8..b41bd381a 100644 --- a/manifest +++ b/manifest @@ -54,4 +54,5 @@ collapse_user_and_admin.sql default_gender_to_null.sql subscribe_email.sql notifications.sql -notification_type_col_rename.sql \ No newline at end of file +notification_type_col_rename.sql +notifications_add_friend_req_id.sql \ No newline at end of file diff --git a/up/notifications_add_friend_req_id.sql b/up/notifications_add_friend_req_id.sql new file mode 100644 index 000000000..c1e1f53f5 --- /dev/null +++ b/up/notifications_add_friend_req_id.sql @@ -0,0 +1 @@ +alter table notifications add COLUMN friend_request_id varchar(64) REFERENCES friend_requests(id); \ No newline at end of file From eb04794d012aa0683e5cb8e54a9ca8071619a173 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 15 Apr 2013 21:10:46 -0500 Subject: [PATCH 119/142] * perfdata --- manifest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest b/manifest index affb2f241..833ff3cd8 100644 --- a/manifest +++ b/manifest @@ -53,4 +53,5 @@ invited_users.sql collapse_user_and_admin.sql default_gender_to_null.sql subscribe_email.sql -notifications.sql \ No newline at end of file +notifications.sql +perf_data.sql From 3733bc0c2d7f2f5c34a8f33ac9c2ad3098b27bc6 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 16 Apr 2013 19:34:37 -0500 Subject: [PATCH 120/142] * perfdata commit --- up/perf_data.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 up/perf_data.sql diff --git a/up/perf_data.sql b/up/perf_data.sql new file mode 100644 index 000000000..3aa6052b1 --- /dev/null +++ b/up/perf_data.sql @@ -0,0 +1,10 @@ +-- this is a history table, so no fk's declared +-- data/datum. but I don't care +CREATE TABLE music_session_perf_data ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + music_session_id VARCHAR(64), + client_id VARCHAR(64), + uri VARCHAR(1000), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From ffffb9a79986bf2d262c6373a73e1413b59fd555 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Wed, 24 Apr 2013 23:50:32 -0700 Subject: [PATCH 121/142] Claimed recordings --- manifest | 1 + up/claimed_recordings.sql | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 up/claimed_recordings.sql diff --git a/manifest b/manifest index b2fa30a36..a993a7b27 100644 --- a/manifest +++ b/manifest @@ -59,3 +59,4 @@ notifications_add_friend_req_id.sql artifact_metadata.sql mixes.sql perf_data.sql +claimed_recordings.sql diff --git a/up/claimed_recordings.sql b/up/claimed_recordings.sql new file mode 100644 index 000000000..923e3617b --- /dev/null +++ b/up/claimed_recordings.sql @@ -0,0 +1,17 @@ +ALTER TABLE recordings_users RENAME TO claimed_recordings; +ALTER TABLE claimed_recordings ADD COLUMN id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(); +ALTER TABLE claimed_recordings ADD COLUMN name VARCHAR(200) NOT NULL; +ALTER TABLE claimed_recordings ADD COLUMN is_public BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE claimed_recordings ADD COLUMN is_downloadable BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE claimed_recordings ADD COLUMN genre_id VARCHAR(64) NOT NULL REFERENCES genres(id); +ALTER TABLE recordings DROP COLUMN description_tsv; +ALTER TABLE recordings DROP COLUMN description; +ALTER TABLE recordings DROP COLUMN name; +ALTER TABLE recordings DROP COLUMN public; +ALTER TABLE recordings DROP COLUMN is_public; +ALTER TABLE recordings DROP COLUMN is_downloadable; +DROP TRIGGER tsvectorupdate ON recordings; +ALTER TABLE recordings ADD COLUMN duration INTEGER; +ALTER TABLE mixes RENAME COLUMN spec TO manifest; +ALTER TABLE mixes DROP COLUMN url; + From 4828df0dfcc141b306fb7d34b904f978962b64e9 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 6 May 2013 15:13:03 -0500 Subject: [PATCH 122/142] * bumping pg_migrate to support ruby2.0 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 875a3fee6..8815d1971 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,4 @@ workspace = ENV["WORKSPACE"] || "~/workspace" # Assumes you have already cloned pg_migrate_ruby in your workspace # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.6' +gem 'pg_migrate', '0.1.7' From c41c5d3b7442ad8b6c68993b4983da92c2d6d00f Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Mon, 6 May 2013 16:11:14 -0700 Subject: [PATCH 123/142] more recordings --- manifest | 1 + up/recordings2.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 up/recordings2.sql diff --git a/manifest b/manifest index a993a7b27..138f2a012 100644 --- a/manifest +++ b/manifest @@ -60,3 +60,4 @@ artifact_metadata.sql mixes.sql perf_data.sql claimed_recordings.sql +recordings2.sql diff --git a/up/recordings2.sql b/up/recordings2.sql new file mode 100644 index 000000000..271a3df07 --- /dev/null +++ b/up/recordings2.sql @@ -0,0 +1,8 @@ +ALTER TABLE recorded_tracks ADD COLUMN md5 VARCHAR(100); +ALTER TABLE recorded_tracks ADD COLUMN length INT; +ALTER TABLE mixes DROP COLUMN owner_id; +ALTER TABLE mixes DROP COLUMN description; +ALTER TABLE mixes ADD COLUMN md5 VARCHAR(100); +ALTER TABLE mixes ADD COLUMN length INT; +DROP TABLE recordings_genres; + From 476829e61d10fd3cbb585cdc4d87cd2297dfbf0e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 10 May 2013 07:09:26 -0500 Subject: [PATCH 124/142] * VRFS-311 - database new columns on user model to hold desired new email as well as email token --- Gemfile.lock | 4 ++-- manifest | 1 + up/update_email.sql | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 up/update_email.sql diff --git a/Gemfile.lock b/Gemfile.lock index 7f2d466c8..8c64e0931 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,7 @@ GEM little-plugger (>= 1.1.3) pg (0.14.0) pg (0.14.0-x86-mingw32) - pg_migrate (0.1.6) + pg_migrate (0.1.7) logging (= 1.7.2) pg (= 0.14.0) thor (= 0.15.4) @@ -17,4 +17,4 @@ PLATFORMS x86-mingw32 DEPENDENCIES - pg_migrate (= 0.1.6) + pg_migrate (= 0.1.7) diff --git a/manifest b/manifest index 138f2a012..9e5bde34a 100644 --- a/manifest +++ b/manifest @@ -61,3 +61,4 @@ mixes.sql perf_data.sql claimed_recordings.sql recordings2.sql +update_email.sql diff --git a/up/update_email.sql b/up/update_email.sql new file mode 100644 index 000000000..e5f711891 --- /dev/null +++ b/up/update_email.sql @@ -0,0 +1,2 @@ +ALTER TABLE users ADD COLUMN update_email VARCHAR(1024); +ALTER TABLE users ADD COLUMN update_email_token VARCHAR(1024) UNIQUE; From 6d9f755a24d08920ad3c8ba89cf447171b80cc23 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Mon, 13 May 2013 16:17:23 -0700 Subject: [PATCH 125/142] update --- manifest | 1 + up/claimed_recordings2.sql | 3 +++ 2 files changed, 4 insertions(+) create mode 100755 up/claimed_recordings2.sql diff --git a/manifest b/manifest index 9e5bde34a..ae7a01f0e 100644 --- a/manifest +++ b/manifest @@ -62,3 +62,4 @@ perf_data.sql claimed_recordings.sql recordings2.sql update_email.sql +claimed_recordings2.sql diff --git a/up/claimed_recordings2.sql b/up/claimed_recordings2.sql new file mode 100755 index 000000000..52306fb0a --- /dev/null +++ b/up/claimed_recordings2.sql @@ -0,0 +1,3 @@ +ALTER TABLE claimed_recordings ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE claimed_recordings ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; + From a4674ce7e9d960a42b42670b9e00769713aa1f11 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Mon, 13 May 2013 22:09:07 -0700 Subject: [PATCH 126/142] added another --- manifest | 1 + up/users_favorites.sql | 3 +++ 2 files changed, 4 insertions(+) mode change 100644 => 100755 manifest create mode 100755 up/users_favorites.sql diff --git a/manifest b/manifest old mode 100644 new mode 100755 index ae7a01f0e..bad1a06f3 --- a/manifest +++ b/manifest @@ -63,3 +63,4 @@ claimed_recordings.sql recordings2.sql update_email.sql claimed_recordings2.sql +users_favorites.sql diff --git a/up/users_favorites.sql b/up/users_favorites.sql new file mode 100755 index 000000000..156ea8131 --- /dev/null +++ b/up/users_favorites.sql @@ -0,0 +1,3 @@ +DROP TABLE users_favorites; + + From 219368c874f8f3092c12f7ed71972fcf711f8f03 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 16 May 2013 11:44:29 -0500 Subject: [PATCH 127/142] * VRFS-315; max_mind_isp table added --- manifest | 1 + up/max_mind_isp.sql | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 up/max_mind_isp.sql diff --git a/manifest b/manifest index bad1a06f3..e42c3c451 100755 --- a/manifest +++ b/manifest @@ -64,3 +64,4 @@ recordings2.sql update_email.sql claimed_recordings2.sql users_favorites.sql +max_mind_isp.sql diff --git a/up/max_mind_isp.sql b/up/max_mind_isp.sql new file mode 100644 index 000000000..ad50a1d52 --- /dev/null +++ b/up/max_mind_isp.sql @@ -0,0 +1,10 @@ +CREATE TABLE max_mind_isp ( + ip_bottom INTEGER, + ip_top INTEGER, + isp VARCHAR(255) +); + +CREATE INDEX max_mind_isp_ip_bottom_idx ON max_mind_isp(ip_bottom); +CREATE INDEX max_mind_isp_ip_top_idx ON max_mind_isp(ip_top); + + From 8f73ec285edcec4af19843eb9df33a9d30217649 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 16 May 2013 12:00:16 -0500 Subject: [PATCH 128/142] VRFS-315; renaming max_mind to max_mind_geo --- up/max_mind_isp.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/up/max_mind_isp.sql b/up/max_mind_isp.sql index ad50a1d52..698feb735 100644 --- a/up/max_mind_isp.sql +++ b/up/max_mind_isp.sql @@ -8,3 +8,4 @@ CREATE INDEX max_mind_isp_ip_bottom_idx ON max_mind_isp(ip_bottom); CREATE INDEX max_mind_isp_ip_top_idx ON max_mind_isp(ip_top); +ALTER TABLE max_mind RENAME TO max_mind_geo; From b3f5e34ef9b1ff6acfcb9b81c515e628e717d276 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 16 May 2013 13:23:38 -0500 Subject: [PATCH 129/142] * VRFS-316 ; adding 'other' to instrument lis --- manifest | 1 + up/other_instrument.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/other_instrument.sql diff --git a/manifest b/manifest index e42c3c451..ea613f0a5 100755 --- a/manifest +++ b/manifest @@ -65,3 +65,4 @@ update_email.sql claimed_recordings2.sql users_favorites.sql max_mind_isp.sql +other_instrument.sql diff --git a/up/other_instrument.sql b/up/other_instrument.sql new file mode 100644 index 000000000..18fb6c9b3 --- /dev/null +++ b/up/other_instrument.sql @@ -0,0 +1 @@ +INSERT INTO instruments (id, description, popularity) VALUES ('other', 'Other', 1); From eeb814fee4830a79a0349624ba1ca31523761614 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 16 May 2013 22:42:50 -0500 Subject: [PATCH 130/142] * adding country code to max_mind_isp --- manifest | 1 + up/max_mind_isp_add_country.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 up/max_mind_isp_add_country.sql diff --git a/manifest b/manifest index ea613f0a5..43f549a38 100755 --- a/manifest +++ b/manifest @@ -66,3 +66,4 @@ claimed_recordings2.sql users_favorites.sql max_mind_isp.sql other_instrument.sql +max_mind_isp_add_country.sql diff --git a/up/max_mind_isp_add_country.sql b/up/max_mind_isp_add_country.sql new file mode 100644 index 000000000..e71cd3efa --- /dev/null +++ b/up/max_mind_isp_add_country.sql @@ -0,0 +1 @@ +ALTER TABLE max_mind_isp ADD COLUMN country VARCHAR(64); From 57fe8c244c1b9e17d0df2725c0f54a060a5b6026 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 30 May 2013 20:50:36 -0500 Subject: [PATCH 131/142] * adding additional avatar column --- .ruby-gemset | 1 + .ruby-version | 1 + .rvmrc | 1 - manifest | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .ruby-gemset create mode 100644 .ruby-version delete mode 100644 .rvmrc diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 000000000..7477464db --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +jam-db diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..95a5ad2d5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-2.0.0-p195 diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 39e913830..000000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm use ruby-1.9.3-p327@jam-db --create diff --git a/manifest b/manifest index 43f549a38..d8f1b3118 100755 --- a/manifest +++ b/manifest @@ -67,3 +67,4 @@ users_favorites.sql max_mind_isp.sql other_instrument.sql max_mind_isp_add_country.sql +avatar_using_filepicker.sql From 00868fe3b5295b8aaefc9dc5a1b0eacda85c8783 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 30 May 2013 20:52:07 -0500 Subject: [PATCH 132/142] * oops. missed actual migartion --- up/avatar_using_filepicker.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 up/avatar_using_filepicker.sql diff --git a/up/avatar_using_filepicker.sql b/up/avatar_using_filepicker.sql new file mode 100644 index 000000000..258f50cee --- /dev/null +++ b/up/avatar_using_filepicker.sql @@ -0,0 +1,8 @@ +-- add columns necessary to store a filepicker original file, cropped file, and original s3 paths to each + +ALTER TABLE users ADD COLUMN original_fpfile VARCHAR(8000) DEFAULT NULL; +ALTER TABLE users ADD COLUMN cropped_fpfile VARCHAR(8000) DEFAULT NULL; +ALTER TABLE users ADD COLUMN cropped_s3_path VARCHAR(512) DEFAULT NULL; +ALTER TABLE users ADD COLUMN crop_selection VARCHAR(256) DEFAULT NULL; +-- photo_url, which already exists on users, is now just the http accessible version of the cropped_s3_path + From 27d94a0ba8829b495b16579790849e401777cb20 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Sat, 8 Jun 2013 17:50:10 -0500 Subject: [PATCH 133/142] VRFS-349: added table for storing raw isp scoring data --- manifest | 1 + up/isp_score_batch.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 up/isp_score_batch.sql diff --git a/manifest b/manifest index d8f1b3118..dd12be2d7 100755 --- a/manifest +++ b/manifest @@ -68,3 +68,4 @@ max_mind_isp.sql other_instrument.sql max_mind_isp_add_country.sql avatar_using_filepicker.sql +isp_score_batch.sql diff --git a/up/isp_score_batch.sql b/up/isp_score_batch.sql new file mode 100644 index 000000000..6475fb585 --- /dev/null +++ b/up/isp_score_batch.sql @@ -0,0 +1,5 @@ +CREATE TABLE isp_score_batch( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + json_scoring_data TEXT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From 8e1e49fc4b554ed01a083a29d797744623da3223 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 5 Jul 2013 13:04:24 -0500 Subject: [PATCH 134/142] * updating jam-db to use pg-migrate 0.1.11 so that we are using pg 0.15.1, which supports windows and ruby 2.0.0 --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 8815d1971..70c0e1813 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,4 @@ workspace = ENV["WORKSPACE"] || "~/workspace" # Assumes you have already cloned pg_migrate_ruby in your workspace # $ cd [workspace] # $ git clone https://github.com/sethcall/pg_migrate_ruby -gem 'pg_migrate', '0.1.7' +gem 'pg_migrate', '0.1.11' diff --git a/Gemfile.lock b/Gemfile.lock index 8c64e0931..e9646a77c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,11 +4,11 @@ GEM little-plugger (1.1.3) logging (1.7.2) little-plugger (>= 1.1.3) - pg (0.14.0) - pg (0.14.0-x86-mingw32) - pg_migrate (0.1.7) + pg (0.15.1) + pg (0.15.1-x86-mingw32) + pg_migrate (0.1.11) logging (= 1.7.2) - pg (= 0.14.0) + pg (= 0.15.1) thor (= 0.15.4) thor (0.15.4) @@ -17,4 +17,4 @@ PLATFORMS x86-mingw32 DEPENDENCIES - pg_migrate (= 0.1.7) + pg_migrate (= 0.1.11) From fe557d9c91dbc4d40fecfb0e392b27780725e177 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 19 Jul 2013 11:49:43 -0500 Subject: [PATCH 135/142] * sniff architecture rather than hardcode it --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index 8ccb13fb5..8d2afbc49 100755 --- a/jenkins +++ b/jenkins @@ -1,7 +1,7 @@ #!/bin/bash GEM_SERVER=http://localhost:9000/gems -DEB_SERVER=http://localhost:9010/apt-i386 +DEB_SERVER=http://localhost:9010/apt-`uname -p` echo "starting build..." ./build From 78ce0c2c581ba9de8fe888456e996c904144233d Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 22 Jul 2013 10:18:23 -0500 Subject: [PATCH 136/142] * updating path for ruby 2.0.0 --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index d4dd5ea48..be6b59275 100755 --- a/build +++ b/build @@ -31,6 +31,6 @@ if [ ! -z "$PACKAGE" ]; then bundle install --path target/vendor/bundle pushd target fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem - find vendor/bundle/ruby/1.9.1/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb + find vendor/bundle/ruby/2.0.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb popd fi From b776bbd3e8b25f4b4fff35ffd504f7f5ba7cf6ae Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Tue, 30 Jul 2013 12:20:36 -0500 Subject: [PATCH 137/142] vrfs-268: added session_removed_at to music_sessions_user_history --- manifest | 2 ++ up/music_sessions_user_history_add_session_removed_at.sql | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 up/music_sessions_user_history_add_session_removed_at.sql diff --git a/manifest b/manifest index 9c60d45ed..48dd0139d 100755 --- a/manifest +++ b/manifest @@ -70,3 +70,5 @@ max_mind_isp_add_country.sql avatar_using_filepicker.sql isp_score_batch.sql crash_dumps.sql +music_sessions_user_history_add_session_removed_at.sql + diff --git a/up/music_sessions_user_history_add_session_removed_at.sql b/up/music_sessions_user_history_add_session_removed_at.sql new file mode 100644 index 000000000..e1f9c800b --- /dev/null +++ b/up/music_sessions_user_history_add_session_removed_at.sql @@ -0,0 +1,2 @@ +-- add session_removed_at to track end of users music_session connection +ALTER TABLE music_sessions_user_history ADD COLUMN session_removed_at TIMESTAMP; From c8dbeb105d3d61e5de52ea2537fcadd0646ade93 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Wed, 31 Jul 2013 18:06:25 -0700 Subject: [PATCH 138/142] added crash_dumps --- manifest | 1 + up/crash_dumps.sql | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100755 up/crash_dumps.sql diff --git a/manifest b/manifest index dd12be2d7..9c60d45ed 100755 --- a/manifest +++ b/manifest @@ -69,3 +69,4 @@ other_instrument.sql max_mind_isp_add_country.sql avatar_using_filepicker.sql isp_score_batch.sql +crash_dumps.sql diff --git a/up/crash_dumps.sql b/up/crash_dumps.sql new file mode 100755 index 000000000..3dd5255a1 --- /dev/null +++ b/up/crash_dumps.sql @@ -0,0 +1,10 @@ +CREATE TABLE crash_dumps ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + client_type VARCHAR(64) NOT NULL, + client_id VARCHAR(64), + user_id VARCHAR(64) REFERENCES users(id), + session_id VARCHAR(64), + timestamp TIMESTAMP, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); From b855ffca2351c02b9dc08d0b44f3d31071f56632 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Wed, 31 Jul 2013 19:00:30 -0700 Subject: [PATCH 139/142] add uri --- up/crash_dumps.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/up/crash_dumps.sql b/up/crash_dumps.sql index 3dd5255a1..4f7b2a3c5 100755 --- a/up/crash_dumps.sql +++ b/up/crash_dumps.sql @@ -5,6 +5,7 @@ CREATE TABLE crash_dumps ( user_id VARCHAR(64) REFERENCES users(id), session_id VARCHAR(64), timestamp TIMESTAMP, + uri VARCHAR(1000), created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); From c2df6e2944f1a8300c4b246ed6b125c73b031d15 Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 6 Aug 2013 07:52:52 -0700 Subject: [PATCH 140/142] Adding indices for crash dumps --- manifest | 1 + up/crash_dumps_idx.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100755 up/crash_dumps_idx.sql diff --git a/manifest b/manifest index 9c60d45ed..b9d66f039 100755 --- a/manifest +++ b/manifest @@ -70,3 +70,4 @@ max_mind_isp_add_country.sql avatar_using_filepicker.sql isp_score_batch.sql crash_dumps.sql +crash_dumps_idx.sql diff --git a/up/crash_dumps_idx.sql b/up/crash_dumps_idx.sql new file mode 100755 index 000000000..ae0bdf2f8 --- /dev/null +++ b/up/crash_dumps_idx.sql @@ -0,0 +1,5 @@ +CREATE INDEX crash_dumps_user_id_idx ON crash_dumps(user_id); +CREATE INDEX crash_dumps_client_id_idx ON crash_dumps(client_id); +CREATE INDEX crash_dumps_timestamp_idx ON crash_dumps(timestamp); + + From 32b5c0c5a8b9bc498e495d01d517575e6426f22d Mon Sep 17 00:00:00 2001 From: Mike Slemmer Date: Tue, 6 Aug 2013 08:12:15 -0700 Subject: [PATCH 141/142] added crash dump client version --- up/crash_dumps_idx.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up/crash_dumps_idx.sql b/up/crash_dumps_idx.sql index ae0bdf2f8..5825f6822 100755 --- a/up/crash_dumps_idx.sql +++ b/up/crash_dumps_idx.sql @@ -2,4 +2,4 @@ CREATE INDEX crash_dumps_user_id_idx ON crash_dumps(user_id); CREATE INDEX crash_dumps_client_id_idx ON crash_dumps(client_id); CREATE INDEX crash_dumps_timestamp_idx ON crash_dumps(timestamp); - +ALTER TABLE crash_dumps ADD COLUMN client_version VARCHAR(100) NOT NULL; From 28ea6542c083c272793d9aab78fb26a771f1af5d Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 18 Aug 2013 02:56:32 +0000 Subject: [PATCH 142/142] * updating ruby version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 95a5ad2d5..abf2ccea0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p195 +ruby-2.0.0-p247