{"ava":{"files":["tests/**/*"],"require":["ts-node/register"],"extensions":["ts"],"compileEnhancements":false},"dist":{"shasum":"80eba9f3deb33b89ea65d41db6bc6c9fef5af48e","tarball":"https://registry.npmjs.org/graphql-migrations/-/graphql-migrations-0.10.0-dev4.tgz","fileCount":283,"integrity":"sha512-vS77RnYlQaqkU12uIkPDzceo3j6Ny2aoNL6Q1l8P32wcfBA1Gh76tWk95gcIxQKtF+GKy6tEs9guK9S4O5o3Ig==","signatures":[{"sig":"MEUCIQC4NtVkM2GuKMAkNyNixkBanxfX7lCZbrgCWRn/9YfRbAIgf85pLQq/gnm+an2/Dgku6/ze8UGFzTQT/ElCyohE2Cw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":475754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8RVICRA9TVsSAnZWagAAhRgP/RkvoqVM5HqcY3PdroFB\nGyLcKmyJh0GvZpZncaBqX4vCB3TIHReUlCA/e+UgTjQNZcijvX113uHeyrRz\nDZT8+uwXeGBY/9tc/p6tVCUEskTV0t/o4jMOdcIvmkxGk/taas7lBV+hBbag\nVdsBgyTJHh1hFGabpJaO/BMSAnRHDD4uDv+BW/rboc/tlGWSgJKpb2PpdIM+\nDvfEZHHoGNwmVZu9UtNNOTz+kkEh11TNjUrIRCJYsFMV7biept4om8lozVLI\ngf4UZVqcW0/xgAL7yKMlBKAnycgYLp1tT9b/gONIO0TfLBhy56iBf1GbkAEG\nrPLL7o3J0T3Nxl4qGW1SAVRflXZ7eghvmQY9mWj7JQSShBP5G+jF74Ez89cz\nj0NqQpXuX2fv8WG8uMcpxFI+firs94M0EPKa/3UoQJrTzU3h35bQx/Pl9Y99\ngGhX8+7TM6k9DBGCC4zfLmu1aUGRqoyQBR2ymg/6ysbjmO0dnhB9Ish6zV7/\n1SJ2dHu6gu+kiA0Dz6uY7O1Yu7YxnPzgedY36hrzuwCDfx+SwtvRYrNYly64\n6Wb34mz+6PA1Wmxzwh6fmiTghb0mS1sXUlQFWkcyuKvLRvF+cz1CqPJAatRg\nedv/xW+qf4NyA7O/sGKoYHZDSY56uCw76+N0NLg9+T+hCpu9zi2BExfGdzkO\nK9wl\r\n=rZ8+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"graphql-migrations","types":"types/index.d.ts","author":{"name":"Enda Phelan","email":"ephelan@redhat.com"},"readme":"## Graphback\n\n<p align=\"center\">\n  <img width=\"400\" src=\"https://github.com/aerogear/graphback/raw/master/website/static/img/graphback.png\">\n  <br/>\n  Auto generate database structure, <br/>\n  GraphQL Resolvers and Queries from GraphQL types 🚀\n</p>\n\n**Documentation**: https://graphback.dev\n**Repository**: https://github.com/aerogear/graphback/\n\n## graphql-migrations\n\nAutomatically create and update your database tables from a GraphQL schema.\n\n### Usage\n\nThe `migrate` method creates and updates your tables and columns to match your GraphQL schema.\n\nAll the database operations are wrapped in a single transaction, so your database will be fully rolled back to its initial state if an error occurs.\n\n```ts\nimport { migrate } from 'graphql-migrations';\n\nconst dbConfig = {\n  client: 'pg',\n  connection: {\n    host: 'localhost',\n    user: 'your-user',\n    password: 'secret-password',\n    database: 'note-db',\n  },\n};\n\nconst schema = buildSchema(`\ntype Note {\n  id: ID!\n  title: String!\n  description: String\n  comments: [Comment]!\n}\n\ntype Comment {\n  id: ID!\n  description: String\n  note: Note!\n}\n`);\n\nmigrate(dbConfig, schema, {\n  // Additional options\n}).then(() => {\n  console.log('Database updated');\n});\n```\n\n### Migration Options\n\n- `config`: database configuration options.\n- `schema`: a GraphQL schema object.\n- `options`:\n  - `dbSchemaName` (default: `'public'`): table schema: `<schemaName>.<tableName>`.\n  - `dbTablePrefix` (default: ''): table name prefix: `<prefix><tableName>`.\n  - `dbColumnPrefix` (default: `''`): column name prefix: `<prefix><columnName>`.\n  - `updateComments`: overwrite comments on table and columns.\n  - `transformTableName` (default: transform to `lowercase`): transform function for table names.\n  - `transformColumnName` (default: transform to `lowerCaseFirstCharacter`): transform function for column names.\n  - `scalarMap` (default: `null`): Custom scalar mapping..\n  - `mapListToJson` (default: `true`): Map scalar lists to JSON column type by default.\n  - `plugins` (default: `[]`): List of graphql-migrate plugins.\n  - `debug` (default: `false`): display debugging information and SQL queries.\n\n### Name transforms\n\nYou can customise how table and coumn names are transformed before applying to the database with `transformTableName` and `transformColumnName`.\n\n```ts\nmigrate(dbConfig, schema, {\n  transformTableName: (name, direction) => {\n    if (direction === 'to-db') {\n      return name.toLowerCase();\n    }\n    return name\n  },\n  transformColumnName: (name, direction) => {\n    if (direction === 'to-db') {\n      // set first character in name to lowercase\n      return `${name.charAt(0).toLowerCase()}${name.slice(1)}`\n    }\n    return name\n  }\n});\n```\n\n### Model Definition\n\n```gql\n\"\"\"\nNotes table\n\"\"\"\ntype Note {\n  \"\"\"\n  Primary key\n  \"\"\"\n  id: ID!\n  \"\"\"\n  The note title\n  \"\"\"\n  title: String!\n}\n```\n\n### Skip table or field\n\n```gql\n\"\"\"\n@db.skip\n\"\"\"\ntype Error {\n  code: Int!\n  message: String!\n}\n\ntype Note {\n  id: ID!\n  title: String\n  \"\"\"\n  @db.skip: true\n  \"\"\"\n  computedField: Boolean\n}\n```\n\n### Rename\n\n```gql\n@db.oldNames: ['task']\ntype Note {\n  id: ID!\n  \"\"\"\n  @db.oldNames: ['text']\n  \"\"\"\n  title: String!\n}\n```\n\n### Nullable and non-nullable field\n\n```gql\ntype Note {\n  id: ID!\n  title: String! # not null\n}\n```\n\n```gql\ntype Note {\n  id: ID!\n  title: String # nullable\n}\n```\n\n### Default value\n\n```gql\ntype Note {\n  id: ID!\n  \"\"\"\n  db.default: 'Note title'\n  \"\"\"\n  title: String\n}\n```\n\n### Primary key\n\nEach type must have a primary key. The primary key field must be `id` and the type must be `ID`.\n\n```gql\ntype Note {\n  id: ID!\n  title: String!\n}\n```\n\n### Foreign key\n\nTo set a foreign key, set a field reference to the related type.\n\n```gql\ntype Comment {\n  id: ID!\n  note: Note! # this creates a `noteId` column in the `comment` table.\n}\n\ntype Note {\n  id: ID!\n  title: String!\n}\n```\n\n### Many-to-many\n\n```gql\ntype User {\n  id: ID!\n  \"\"\"\n  @db.manyToMany: 'users'\n  \"\"\"\n  messages: [Message]\n}\n\ntype Message {\n  id: ID!\n  \"\"\"\n  @db.manyToMany: 'messages'\n  \"\"\"\n  users: [User]\n}\n```\n\n### Many-to-many on same type\n\n```gql\ntype User {\n  id: ID!\n  friends: [User]\n}\n```\n\n### Simple index\n\n```gql\ntype User {\n  id: ID!\n  \"\"\"\n  @db.index\n  \"\"\"\n  email: String!\n}\n```\n\n### Multiple index\n\n```gql\ntype User {\n  \"\"\"\n  @db.index\n  \"\"\"\n  id: String!\n\n  \"\"\"\n  @db.index\n  \"\"\"\n  email: String!\n}\n```\n\n### Named index\n\n```gql\ntype User {\n  \"\"\"\n  @db.index: 'myIndex'\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  @db.index: 'myIndex'\n  \"\"\"\n  name: String!\n}\n```\n\nYou can specify the index type on PostgreSQL.\n\n```gql\ntype User {\n  \"\"\"\n  @db.index: { name: 'myIndex', type: 'hash' }\n  \"\"\"\n  email: String!\n\n  \"\"\"\n  You don't need to specify the type again.\n  @db.index: 'myIndex'\n  \"\"\"\n  name: String!\n}\n```\n\n### Unique constraint\n\n```gql\ntype User {\n  id: ID!\n  \"\"\"\n  @db.unique\n  \"\"\"\n  email: String!\n}\n```\n\n### Custom name\n\n```gql\n\"\"\"\n@db.name: 'people'\n\"\"\"\ntype Note {\n  id: ID!\n  \"\"\"\n  @db.name: 'noteTitle'\n  \"\"\"\n  title: String!\n}\n```\n\n### Custom column type\n\n```gql\ntype Note {\n  id: ID!\n  \"\"\"\n  @db.type: 'string'\n  @db.length: 100\n  \"\"\"\n  title: String!\n}\n```\n\n### List\n\n```gql\ntype Note {\n  id: ID!\n  title: String!\n  \"\"\"\n  @db.types: 'json'\n  \"\"\"\n  comments: [String]\n}\n```\n\nYou can also set `mapListToJson` to `true` in the migrate options to automatically map scalar and enum lists to JSON.\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":"Create & migrate Databases from GraphQL Schema","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":{"case":"1.6.1","glob":"7.1.6","knex":"0.20.2","pino":"5.14.0","lodash":"4.17.15","lodash-es":"4.17.15","node-emoji":"1.10.0","@graphback/core":"^0.10.0-rc2","graphql-annotations":"^0.0.3","@graphql-inspector/core":"1.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"pg":"^7.8.0","ava":"2.4.0","rimraf":"3.0.0","tslint":"5.20.1","graphql":"^14.5.8","sqlite3":"4.1.0","ts-node":"8.5.2","tsutils":"3.17.1","typescript":"3.7.2","@types/jest":"^24.0.11","@types/node":"12.12.12","@types/lodash":"4.14.108","graphql-tools":"^4.0.4","@types/graphql":"14.2.3"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-migrations_0.10.0-dev4_1576080712203_0.6635364021530221","host":"s3://npm-registry-packages"},"_id":"graphql-migrations@0.10.0-dev4","version":"0.10.0-dev4"}