From a850e369ff2a7f13caa1de40e96cfee6cef5da54 Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Mon, 1 Oct 2018 09:57:25 -0500 Subject: [PATCH] use GOPATH for migration script; update postgraphile to watch db schema --- postgraphile/spec/server/runtime.spec.ts | 1 + postgraphile/src/adapters/postgraphile.ts | 1 + postgraphile/src/server/config.ts | 1 + scripts/create_migration | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/postgraphile/spec/server/runtime.spec.ts b/postgraphile/spec/server/runtime.spec.ts index 0d3d993d..3e62a9f4 100644 --- a/postgraphile/spec/server/runtime.spec.ts +++ b/postgraphile/spec/server/runtime.spec.ts @@ -27,6 +27,7 @@ describe('bootServer', () => { middleware: jasmine.createSpyObj(['call']), options: { pluginHook: jasmine.createSpy('pluginHook'), + watchPg: true, simpleSubscriptions: true, graphiql: true, webSocketMiddlewares: [] }, diff --git a/postgraphile/src/adapters/postgraphile.ts b/postgraphile/src/adapters/postgraphile.ts index 629f344e..c7013359 100644 --- a/postgraphile/src/adapters/postgraphile.ts +++ b/postgraphile/src/adapters/postgraphile.ts @@ -11,6 +11,7 @@ export interface PostgraphileMiddleware extends RequestHandler {} export interface PostgraphileOptions { pluginHook: PluginHookFn, simpleSubscriptions: boolean; + watchPg: boolean; graphiql: boolean; // NOTE (jchristie@8thlight.com) Shape of the middlewares is not // currently important to this application, but if a need arises, diff --git a/postgraphile/src/server/config.ts b/postgraphile/src/server/config.ts index 05dca1f3..c5acf974 100644 --- a/postgraphile/src/server/config.ts +++ b/postgraphile/src/server/config.ts @@ -27,6 +27,7 @@ export function buildServerConfig( const options: PostgraphileOptions = { pluginHook: pluginHook, simpleSubscriptions: true, + watchPg: true, graphiql: true, webSocketMiddlewares: [ expressSessionHandler, diff --git a/scripts/create_migration b/scripts/create_migration index 82be868e..27e4a1bc 100755 --- a/scripts/create_migration +++ b/scripts/create_migration @@ -2,7 +2,7 @@ if [ $# -eq 1 ] then - $GOBIN/migrate create -dir ./db/migrations -ext sql $1 + $GOPATH/bin/migrate create -dir ./db/migrations -ext sql $1 else echo "**An Error Occurred**" echo "Usage: ./scripts/create_migration "