* db changes required for minimal sessions API
This commit is contained in:
parent
562eaea844
commit
f3c21dba51
2
build
2
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue