{"_id":"@0ti.me/postgres-db-versioning","_rev":"3-393256fa0975f098214c44cfa88aa0cc","name":"@0ti.me/postgres-db-versioning","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.1":{"name":"@0ti.me/postgres-db-versioning","version":"0.1.1","description":"A library for managing PostgresDB migrations and initialization","license":"GPL-3.0","main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/0time/postgres-db-versioning.git"},"scripts":{"lint":"eslint .","run-coveralls":"NODE_ENV=unit nyc report --reporter=text-lcov | coveralls","test":"yarn lint && yarn test:unit && yarn test:coveralls && yarn test:integration","test:coveralls":"if-env-run CI yarn run-coveralls","test:integration":"export NODE_ENV=integration && nyc mocha && nyc check-coverage","test:unit":"NODE_ENV=unit nyc mocha"},"dependencies":{"@0ti.me/tiny-pfp":"0.1.13","config":"^3.3.1","husky":"^4.2.5","lint-staged":"^10.2.11","lodash.merge":"^4.6.2","pg":"^8.3.2","pg-format":"^1.0.4"},"devDependencies":{"@0ti.me/test-deps":"0.1.20"},"publishConfig":{"access":"public"},"gitHead":"c00c307c48db3030eaeea94d7b610757ae3e9645","bugs":{"url":"https://github.com/0time/postgres-db-versioning/issues"},"homepage":"https://github.com/0time/postgres-db-versioning#readme","_id":"@0ti.me/postgres-db-versioning@0.1.1","_nodeVersion":"10.18.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-6kd8rAE58+ETUNpg1ppR/gjEjOjA9k2p3d/28BurT7beGfg9liNhd3ZIYgVq89R2mNt7h/j3/F3gbv+FJMiz4A==","shasum":"da52a5e03de6bcb5d1e05a89d1a588d529f146c8","tarball":"https://registry.npmjs.org/@0ti.me/postgres-db-versioning/-/postgres-db-versioning-0.1.1.tgz","fileCount":42,"unpackedSize":37437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTtl7CRA9TVsSAnZWagAAtfIP/iKl6Kv8N/lsbL6UjrJt\nj2lbnmepnJnsVIyUdVFtnyP7jdSjAfOXqSfLA4QcdCvpd8VLgocbqnUW+vK0\n6B9B9CUdVNRedzMeyS101PdAg48e6RYxkdug21i04bOgXkuNkqUcde0BJuI8\naJfnIWbku/4HebEhjYNyZHoD6F+AyBw5C9KHFtNLIGVjdxos78BCgUQgYiwy\nffGje23qZgkxZt72vEtJzv3c/8k6tvUa5mtuJYqJeZP9GrJN1nr4VHHYp7So\nu9Ri32zkfpYwgp+8BwGFkb0M6ItyFIe2npSiA7VgpgBcvONE0b+7z0wUjnAn\nOMknc6P+z390J7oXxniy27gFW8WIFmv5h58bmACNsYXbGruOiwqjJVtJkrHW\nnHebCfuYKfEssanev7LAfzRw2ocQwPbl0+RMxeclNz0TTXxFNhCA3KkTcV5j\nevWhaELtzlLPgI866FL9j2Hsu7H1DmyQrCV45HDuQG8xEu2LsSWbnpei+MT4\n4SrbHLt6NkVwc/Z20EMKoKLfNgamSbiNrKtkDGKz7E1bkGz5eRoY2VTowZVY\nRCkeWJoKz42bG10fwpN3CfWSpQoCVUPMUBYflgy2CPZMcM8zfV/pzNDbmxIa\nze3tcyJTxM9OftVXfco51/UHcpMq2S54Z6OyDh2oVFUZhBs3UfGStcdF5yq5\n/SN+\r\n=vSf1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8St2azeeswq2QEihsrhyaOsKwAdSH0GYOL4U9qmdvDQIhAIZcy5YA7t3kNy7sM8MyEe9cFz0Wf3n+Q+G+Op+SOgmE"}]},"maintainers":[{"name":"hibes","email":"npm@0ti.me"}],"_npmUser":{"name":"hibes","email":"npm@0ti.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-db-versioning_0.1.1_1599003002496_0.4670749829776948"},"_hasShrinkwrap":false},"0.1.2":{"name":"@0ti.me/postgres-db-versioning","version":"0.1.2","description":"A library for managing PostgresDB migrations and initialization","license":"GPL-3.0","main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/0time/postgres-db-versioning.git"},"scripts":{"lint":"eslint .","run-coveralls":"NODE_ENV=unit nyc report --reporter=text-lcov | coveralls","test":"yarn lint && yarn test:unit && yarn test:coveralls && yarn test:integration","test:coveralls":"if-env-run CI yarn run-coveralls","test:integration":"export NODE_ENV=integration && nyc mocha && nyc check-coverage","test:unit":"NODE_ENV=unit nyc mocha"},"dependencies":{"@0ti.me/tiny-pfp":"0.1.13","config":"^3.3.1","husky":"^4.2.5","lint-staged":"^10.2.11","lodash.merge":"^4.6.2","pg":"^8.3.2","pg-format":"^1.0.4"},"devDependencies":{"@0ti.me/test-deps":"0.1.20"},"publishConfig":{"access":"public"},"gitHead":"bc322bf7005691ade5f5d740058211e743d74a02","bugs":{"url":"https://github.com/0time/postgres-db-versioning/issues"},"homepage":"https://github.com/0time/postgres-db-versioning#readme","_id":"@0ti.me/postgres-db-versioning@0.1.2","_nodeVersion":"10.18.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Jclav5cb5NPhVf1m6vZUn0nSKY4jQdtPuvUiVDX48FFN/7ywFxzYNUinU0he1mJpYvntLiPY7EjSNds0VKShMA==","shasum":"fa4fc00fedcd6d88587a09117bcf4028c3b065e4","tarball":"https://registry.npmjs.org/@0ti.me/postgres-db-versioning/-/postgres-db-versioning-0.1.2.tgz","fileCount":42,"unpackedSize":37392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT8aPCRA9TVsSAnZWagAALKoP/2ZB16qDhoOGyNetp+0c\nOH4jWJh1VlGcblvNilohnTjfET4cGo5/+hwGQ75MuYXCi3VPfh/7Qa7WKAgl\nkt4SROSakLObCIxUWWye1yfsk5cexLMDj/cplOGmDnrlzFVWIrrCSUQ48yhC\nf/wfErZSkilIjQIS+lxVgq4rh8k7CRUHRdBrOANgeCjQEsTsWX1SL7MgbZa3\nrbcqDDmupdknuwnQdlTJWUMlgvxRAkl4oBr5SAwVmVfygU/Aii6BA573wDWi\nOkmt7HSM9Q/i8dxj6inb39HPohs2VkIHg7SBVK0VgXvi7uCjbGD1v1WHpGoZ\nJz9ksQ9WL5cTiX3/MhPH5F7x6Kly06JTG24le5QuN3/BaIPfFSThYaYKiSUk\nRryMWFXZla+hLE6OG2JrWipeDfVWzU/iARxT15yq5UBa2D4FCQm1xvpF8TvU\n1dIYP9te2Y9+qhj6qJxpnXENG9N8DCdNlL9DEtDdP7DrvChNNe1FqpMaL/OG\nW/BNSwfKRDLfmIPDtaihTJMXLL6honfg8Gc9wNciPF+T5jcKQ91UpL9Tz7DA\nloJIP7wvRJ6DnWVU1ks4aCtswarlp+0ZrLGXUkzzYrma3heB7G5cSLCS+8Sw\nT7cAIIwzQ/E2GcNq8XzIjp7LKzBUEKQH9NwVtrptG80T9GQtn8mfCgIuKUzp\nxa7H\r\n=oEXx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGkKOt0NbFBXctEoKm5rvPtEZ9e3IHfu6aNmrtiDDxXAIgKWxoG6D7LZlCLfBQI6Gf7ro/hDpEl+AEOz0DDyWXBIk="}]},"maintainers":[{"name":"hibes","email":"npm@0ti.me"}],"_npmUser":{"name":"hibes","email":"npm@0ti.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-db-versioning_0.1.2_1599063694293_0.9815452821396329"},"_hasShrinkwrap":false},"0.1.3":{"name":"@0ti.me/postgres-db-versioning","version":"0.1.3","description":"A library for managing PostgresDB migrations and initialization","license":"GPL-3.0","main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/0time/postgres-db-versioning.git"},"scripts":{"lint":"eslint .","run-coveralls":"NODE_ENV=unit nyc report --reporter=text-lcov | coveralls","test":"yarn lint && yarn test:unit && yarn test:coveralls && yarn test:integration","test:coveralls":"if-env-run CI yarn run-coveralls","test:integration":"export NODE_ENV=integration && nyc mocha && nyc check-coverage","test:unit":"NODE_ENV=unit nyc mocha"},"dependencies":{"@0ti.me/tiny-pfp":"0.1.13","config":"^3.3.1","husky":"^4.2.5","lint-staged":"^10.2.11","lodash.merge":"^4.6.2","pg":"^8.3.2","pg-format":"^1.0.4"},"devDependencies":{"@0ti.me/test-deps":"0.1.20"},"publishConfig":{"access":"public"},"gitHead":"6ecd7fc5cce3f608d448fa6c920dc7337969d2a4","bugs":{"url":"https://github.com/0time/postgres-db-versioning/issues"},"homepage":"https://github.com/0time/postgres-db-versioning#readme","_id":"@0ti.me/postgres-db-versioning@0.1.3","_nodeVersion":"10.18.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-tDv8Y7omhhOoFsZXqFNZJt3oHIORcStwVMuviFercu09qx7DKKt5B6joce6cH8SHcT7ibdfjlScxx3MzdlkFUw==","shasum":"daaa9924a3fec5430cebe1ca69ee1e30ff28fb2b","tarball":"https://registry.npmjs.org/@0ti.me/postgres-db-versioning/-/postgres-db-versioning-0.1.3.tgz","fileCount":39,"unpackedSize":36099,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUCtrCRA9TVsSAnZWagAA49oP/0RsZfIAKPfxouXSDbdG\nSio4zv3H09ufkvzIurdOMKclJgDLzDFUpJCIJUxdNyu9DeTb/hq/pTT4q2WO\nymoq2QxwBOol6TK1obvfve+vOI5dgxCHk4MwvScHSA2ZDSMeILORyG/k5Lcf\nch1uAiDAB4FHFvSmfKQy7TD4Rc+mAF/67ZF6PbNQK8mj0tsIlHN5sCoUkDFt\nAeEfXFbfWzvdbgA0xIHD6i3OGM4LKqpFKhilOhTTZLNmPBW7k1lgscE3fJQp\nzj7C9SMViJUoxFEGFeRuOCdqqmAIoAbsUAR6BvgYoNKKaxS0ghVA8tr+JOxy\nxbAwQvIh3hsLaCOM6+f7HIcwyLXZnCl49OvIfKcOKl9Sund/geDMRO4CLMD9\n1LN9c3Z2st/F5bheGl6lMZl+3dgIBXE40DNgAu9fBjAsUvP6XOmbKUaHwh/s\nLXcr+nx3v1F/8h2bFuFW0yr7a6/7uT23FrmRW25wdLVSG7uumlfZ4tMKpnWG\nkq+hZyD0qY9wMk0JLtzwv5XNLJzm+QzzIGKgy/p3fXKo+YHRpr2WC07B7QcQ\nBeqTgB6FqPQ9sWxUHO8lwn3bzA8hbSca/a2XqQkUYHTCeejF4682Azs8Hgqg\nTYs4YfrMxiQ2JoNgjMWejtRWvscLOUDoe/KZaw3fYwPRMHudeFfmmQQRika/\nsT2r\r\n=kZMJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsjEZC2McQLUs5JdDhjgS5Ch5vq7herUoAYrWkR8lA4wIhAKkJxtzThJ47wUc5+fJBsiuTyZ5ks4IM3f5zPBQuRGuq"}]},"maintainers":[{"name":"hibes","email":"npm@0ti.me"}],"_npmUser":{"name":"hibes","email":"npm@0ti.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgres-db-versioning_0.1.3_1599089514886_0.8320301171717677"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-01T23:30:02.292Z","0.1.1":"2020-09-01T23:30:02.655Z","modified":"2022-04-04T10:26:16.294Z","0.1.2":"2020-09-02T16:21:34.390Z","0.1.3":"2020-09-02T23:31:55.049Z"},"maintainers":[{"name":"hibes","email":"npm@0ti.me"}],"description":"A library for managing PostgresDB migrations and initialization","homepage":"https://github.com/0time/postgres-db-versioning#readme","repository":{"type":"git","url":"git+https://github.com/0time/postgres-db-versioning.git"},"bugs":{"url":"https://github.com/0time/postgres-db-versioning/issues"},"license":"GPL-3.0","readme":"# PostgresDB Versioning\n\nRelational databases must be versioned if their data and tables are to be migrated properly over time. This project seeks to produce an NPM module which does the heavy lifting using configuration and version data supplied by whatever depends on this module.\n\n## Configuration\n\n    {\n      \"connectionConfig\": {\n        \"user\": \"postgres\",\n        \"password\": \"postgres\",\n        \"host\": \"localhost\",\n        \"database\": \"postgres\",\n        \"port\": 54231\n      },\n      \"dryRun\": false\n      \"eventHandler\": (...eventArgs) => console.error(event),\n      \"migrations\": [\n        {\"version\": 1, \"description\": \"create the table a_table\", \"sql\": \"CREATE TABLE a_table (id INT);\"},\n        {\"version\": 2, \"description\": \"add the table another_table\", \"sql\": \"CREATE TABLE another_table (id INT);\"}\n      ],\n      \"pool\": {\n        query: sqlString => console.error(sqlString)\n      },\n      \"requestedVersion\": 2,\n      \"scratch\": [\n        \"CREATE TABLE table_name\"\n      ],\n      \"tableNameForVersions\": \"DatabaseVersion\",\n      \"version\": 1\n    }\n\n### Connection Config\n\nIf this module should manage the connection, then pass in a config object with this API: https://node-postgres.com/api/client/.\n\n### Dry Run\n\nWith this feature enabled, the steps which would be performed will be sent as events to the event handler.\n\n### Event Handler\n\nIf this is set, it will emit events (either a string for the query or an array crafted from the (...args) which will be applied to the query function call.\n\nFor example, if the eventHandler is called with multiple arguments, such as: 'SELECT * FROM x WHERE x.y = ?;' and ['fred'], then when the plan executes, it would execute something like this:\n\n    pool.query('SELECT * FROM x WHERE x.y = ?;', ['fred']);\n\nIf the eventHandler is called with just a string, like 'SELECT * FROM x;', it would execute something like this:\n\n    pool.query('SELECT * FROM x');\n\n### Migrations\n\nMigrations should be an array of objects containing a version number, an optional description of the changes, and the sql that should be executed.\n\n### Pool\n\nIf included, this will be used blindly to send queries to the DB. It will be assumed that it implements this API: https://node-postgres.com/api/pool/. This option takes priority over `\"connectionConfig\"`, so don't provide `\"pool\"` if you want to use `\"connectionConfig\"`.\n\n### Requested Version\n\nIf provided, it will stop trying to migrate at the requested version. This will disable use of scratch if the `\"version\"` is greater than the `\"options\".\"requestedVersion\"`.\n\nIf not provided, the max of `\"options\".\"version\"` and of the highest `\"version\"` in `\"options\".\"migrations\"` will be used.\n\n### Scratch\n\nIf provided, the `scratch` array will be used to populate the database if the `\"tableNameForVersions\"` table is not yet present. Migrations with a `\"version\"` greater than `\"options\".\"version\"` will be also executed by making the assumption that the `\"options\".\"version\"` version has been achieved.\n\nIf not provided, the migrations array will be used.\n\n### Table Name for Versions\n\nThis allows you change the name used to track versions of the DB.\n\n### Version\n\nThis should be the same as the version which is created by `\"scratch\"`.\n","readmeFilename":"README.md"}