{"name":"graphql-migrations","version":"0.10.0-rc2","description":"Graphback database migrations","main":"dist/index.js","types":"types/index.d.ts","typescript":{"definition":"types/index.d.ts"},"dependencies":{"@graphback/core":"^0.10.0-rc2","@graphql-inspector/core":"1.26.0","chalk":"2.4.2","glob":"7.1.6","knex":"0.20.2","node-emoji":"1.10.0","pg":"7.14.0","pino":"5.14.0","sqlite3":"4.1.0"},"devDependencies":{"@types/chalk":"0.4.31","@types/graphql":"14.2.3","@types/node":"12.12.12","ava":"2.4.0","graphql":"^14.5.8","rimraf":"3.0.0","ts-node":"8.5.2","tslint":"5.20.1","tsutils":"3.17.1","typescript":"3.7.2"},"scripts":{"clean":"rimraf coverage dist types","build":"tsc","watch":"tsc -w ","lint":"tslint -t stylish --project \"tsconfig.json\"","test":"ava","pretest":"npm run build"},"ava":{"files":["tests/**/*"],"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"]},"engines":{"node":">=10.15.3"},"author":{"name":"ephelan@redhat.com"},"license":"Apache-2.0","publishConfig":{"access":"public"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0"},"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","readmeFilename":"README.md","_id":"graphql-migrations@0.10.0-rc2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"wtrocki","email":"wtrocki@redhat.com"},"dist":{"integrity":"sha512-tsOOq2baJ8mZeqUMo1G14deYInkyFA6hl0q2+fDsKCpuTb+GowH4u+UVVo5diWwu2VuYTZa62BPTd/kFZRcTQg==","shasum":"0fddc3ae06d60689d929e54540b77b790e1e1155","tarball":"http://registry-npm.ywwl.com/graphql-migrations/download/graphql-migrations-0.10.0-rc2.tgz","fileCount":99,"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","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+kwe2ZZDROfk/lsanC5FZwYmItxek7EYt/mAkcuWr5AiAFR/mBD51fiVa+YMtSfsB97KWdJd4iS18qgIfKnGCCmA=="}],"size":27928,"noattachment":false,"key":"/graphql-migrations/-/graphql-migrations-0.10.0-rc2.tgz"},"maintainers":[{"email":"dara.s.hayes@gmail.com","name":"aerogear-ci"},{"email":"ephelan@redhat.com","name":"ephelan"},{"email":"wtrocki@redhat.com","name":"wtrocki"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-migrations_0.10.0-rc2_1574531827029_0.10763419229086901"},"_hasShrinkwrap":false,"publish_time":1574531827121,"_cnpm_publish_time":1574531827121,"dist-tags":{"dev":"0.10.0-dev4","latest":"1.1.2","next":"1.1.0-alpha2"}}