{"ava":{"files":["tests/**/*"],"require":["ts-node/register"],"extensions":["ts"],"compileEnhancements":false},"dist":{"shasum":"0fddc3ae06d60689d929e54540b77b790e1e1155","tarball":"https://registry.npmjs.org/graphql-migrations/-/graphql-migrations-0.10.0-rc2.tgz","fileCount":99,"integrity":"sha512-tsOOq2baJ8mZeqUMo1G14deYInkyFA6hl0q2+fDsKCpuTb+GowH4u+UVVo5diWwu2VuYTZa62BPTd/kFZRcTQg==","signatures":[{"sig":"MEQCIB+kwe2ZZDROfk/lsanC5FZwYmItxek7EYt/mAkcuWr5AiAFR/mBD51fiVa+YMtSfsB97KWdJd4iS18qgIfKnGCCmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":124358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2XLzCRA9TVsSAnZWagAAeScP+wbFrJ6A/x7LCWcQOG8G\nFhrJBHIHujGldCZLnrrzaswEpDWyV87/jzlG00lzKZNJJ/bC/rV1MKwzkLxP\nmng4/0v/coXJSjYtfUglw/UgYgHdvfJH8E5XMrzo7KP1Hl1V6hiZFOXBdPEW\noJ29nKcwGKoopYC9SArKcMpVbg6hgQVWCzZlj+zqgUH4ivpfO3+mvo6uj+UV\nByQ890Pw0yi7qQ5kH/Ytw4CdDIRtNbxhvuKh0tgP/NQV2FPyn9jpsBsZg3Qm\nBXsVks4Oxxck8pV9JHEhY++ZtjiBG4Tno66+4E3ppO0UzAWlv/HwuWqzRWDg\n/VtHEF/Rgo2VZkGHGte10mHwjK97ektCbUf3x/6coUD6azscZeJ7wl6DmXlG\nN5BI/41A5rfpg3rdPEIM8E2WlUUE1OodJXUPDLivJ/SlQbA0kH/aE8SyqVA9\neEmCw0rZiBf8jmMIaGBAlyXbbyGWZIvBCBjeUCVpAUY29stU6CIzbIeK0m5L\nmI9d7ZWXIcl3ma8PXUBjruH+jfcwMlpwlhuFRf1r8RYmQ53L5E9sZ2ZP9GQD\nq1BLbf6IFmYIGTncVX4PxDU2w5e1aPLNmqbbKAfzr8Of9dH9QVBJ7H2WygZY\n38wj/GzvnG1zFGWqe+tCCL5lOawrlvdyodC18FRaG2jXx1qeHVoFnTTEOtfu\n+jdF\r\n=lYMF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"graphql-migrations","types":"types/index.d.ts","author":{"name":"ephelan@redhat.com"},"readme":"## graphql-migrations\n\nAutomatically updates your database structure from a GraphQL schema.\n\n## Usage\n\n### Strategies\n\n- `DropCreateDatabaseAlways` - Drops and creates the database every time the application is run.\n- `UpdateDatabaseIfChanges` - Only update the database when your input schema has been changed.\n\n### Configuration\n\nHere is an example of how to configure database initialization strategies.\n\n#### Performing automatic migrations\n\n```ts\nimport { migrate, UpdateDatabaseIfChanges } from 'graphql-migrations';\nimport { migrationsDir } from './config';\nimport { schemaText } from './schema';\n\nconst db = Knex(...);\n\nconst databaseInitializationStrategy = new UpdateDatabaseIfChanges(db, migrationsDir);\n\nawait migrate(schemaText, dbInitialization);\n\nconst pubSub = new PubSub();\nconst runtime = await backend.createRuntime(dbClientProvider, pubSub);\n```\n\n#### Drop and recreate database every time\n\nThis mode is useful for when you are in development mode and don't care about saving migrations.\n\n```ts\nimport { migrate, DropCreateDatabaseAlways } from 'graphql-migrations';\nimport { migrationsDir } from './config';\nimport { schemaText } from './schema';\n\nconst db = Knex(...);\n\nconst databaseInitializationStrategy = new DropCreateDatabaseAlways('pg', db);\n\nawait migrate(schemaText, dbInitialization);\n\nconst pubSub = new PubSub();\nconst runtime = await backend.createRuntime(dbClientProvider, pubSub);\n```\n\n## Limitations\n\nSchema migrations are in a very early phase. At present the change types that are allowed is limited to the following:\n\n- **TYPE_ADDED** - Adding a new GraphQL type to your model will create an associated database table.\n- **FIELD_ADDED** - Adding a field to an existing model will create a new column in your database table.\n\n- Relationships are not yet supported and will be added very soon.\n- Fields cannot be set to `NOT NULL` in the database.\n","engines":{"node":">=10.15.3"},"license":"Apache-2.0","scripts":{"lint":"tslint -t stylish --project \"tsconfig.json\"","test":"ava","build":"tsc","clean":"rimraf coverage dist types","watch":"tsc -w ","pretest":"npm run build"},"_npmUser":{"name":"wtrocki","email":"wtrocki@redhat.com"},"typescript":{"definition":"types/index.d.ts"},"_npmVersion":"6.4.1","description":"Graphback database migrations","directories":{},"maintainers":[{"name":"aerogear-ci","email":"dara.s.hayes@gmail.com"},{"name":"ephelan","email":"ephelan@redhat.com"},{"name":"wtrocki","email":"wtrocki@redhat.com"}],"_nodeVersion":"10.15.3","dependencies":{"pg":"7.14.0","glob":"7.1.6","knex":"0.20.2","pino":"5.14.0","chalk":"2.4.2","sqlite3":"4.1.0","node-emoji":"1.10.0","@graphback/core":"^0.10.0-rc2","@graphql-inspector/core":"1.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ava":"2.4.0","rimraf":"3.0.0","tslint":"5.20.1","graphql":"^14.5.8","ts-node":"8.5.2","tsutils":"3.17.1","typescript":"3.7.2","@types/node":"12.12.12","@types/chalk":"0.4.31","@types/graphql":"14.2.3"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-migrations_0.10.0-rc2_1574531827029_0.10763419229086901","host":"s3://npm-registry-packages"},"_id":"graphql-migrations@0.10.0-rc2","version":"0.10.0-rc2"}