{"_id":"@bocoup/careen","_rev":"4-2306558a7bd94a5112ad0f91c9c4eb4d","name":"@bocoup/careen","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@bocoup/careen","version":"0.1.1","keywords":["sql","schema","migration"],"author":{"url":"http://cmcenroe.me","name":"Curtis McEnroe","email":"curtis@cmcenroe.me"},"license":"ISC","_id":"@bocoup/careen@0.1.1","maintainers":[{"name":"mariestaver","email":"marie@bocoup.com"},{"name":"jugglinmike","email":"mike@mikepennisi.com"},{"name":"robocoup","email":"infrastructure@bocoup.com"}],"homepage":"https://github.com/programble/careen","bugs":{"url":"https://github.com/programble/careen/issues"},"bin":{"careen":"bin/careen.js"},"dist":{"shasum":"1bcb9a388ddeba476befdfdfec0b505113344777","tarball":"https://registry.npmjs.org/@bocoup/careen/-/careen-0.1.1.tgz","fileCount":126,"integrity":"sha512-oKslY1A9kXudanVoqNMK9vE3Zn2l6rqj1/6CG6a6KHVt1tacDD/2ESpK+s9dpT0VaNQ6LCbfT+8ztiL31pPD2g==","signatures":[{"sig":"MEUCIEgtZuFSTht3sZLxpN+JSDTYOqsy41VWSeXP3F9jYNSqAiEA0iEBnGd0BjYFCrPkfMP68w1E0marRZZpj+1zO1HV5CE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":457557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsSavCRA9TVsSAnZWagAAvtQQAJxCNq8ICXFs/nEeZT8+\nFTfuYnpuWsAd091sIaKQidQHi5B1PnJRn3AcxCJsWDWRlsgPADPVJcItw/u8\nmLKg7TFfDrn8tyQNhaWGBBYLfDtrmukES3CdDAFMykADweiGOQzmSINbwWk1\nGx3tZ1ywvvxUfLUn/TVZGNEWrGtirG1uKIvWpekWvU4E+lwrMyi1Pk9t0pnv\n07m6Ior37KiGq4ff68SQH4ofyCLqpB9f88MOXnSdg309y/285tBU4qo8WwLx\nubYBrAZAh24RONd5jspf6VLqNm0Qz66yV0c0gvho8lMqKNiRd1sx15vislcw\n/9bfgFyTO//v3ePJfnxvF0EpV/4b8a1MQw6fkeA5KEx/sPkwpptfQacz6maw\n0LxMFLHvMxHrX2ovOCIh4MKIP6YqGAew5TWlhMz6YsvRzuyPjkv9qHyeZZXa\n5yIowz+fSmhu2eHiZoqisxOL/vvUm3HQusABRLfCoIvAgUl3Y4Pz0QjPrQeg\nLVKh4oGVPcyW2grON8y+VN5zZLWVw8ncHM4OZo0Ejh+ulDhBECzzCnE9mTAE\nDRWzdo3JQLnbmfg/RjwT922/FKlnOJD4T4RfJkjXbSTqcBPfPFHP54cF7VtW\np6x3AbAIKFX95f6xdfRwQonrxrCQ3sBazk6Pi3N4jEp/pmGNF/z4Vl9/8Yp6\nMmAP\r\n=287m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","_from":"careen@0.1.1","scripts":{"test":"npm run build-test && npm run mocha","build":"tsc","clean":"find lib test -name '*.js' -delete && rm -rf coverage","mocha":"mocha","coverage":"npm run build-test && npm run istanbul","istanbul":"istanbul cover node_modules/.bin/_mocha","coveralls":"coveralls < coverage/lcov.info","build-test":"tsc -p test","prepublish":"npm run build"},"_npmUser":{"name":"jugglinmike","email":"mike@mikepennisi.com"},"_resolved":"https://registry.npmjs.org/careen/-/careen-0.1.1.tgz","_integrity":"sha1-KYoBy+QsowU0GzK9RunOAT7AZbM=","repository":{"url":"git+https://github.com/programble/careen.git","type":"git"},"_npmVersion":"6.14.11","description":"SQL schema migration. Nothing more. Nothing less.","directories":{},"_nodeVersion":"14.16.0","dependencies":{"chalk":"^1.0.0","ramda":"^0.15.0","bluebird":"^2.9.14","minimist":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^4.3.0","mocha":"^2.2.1","sinon":"^1.14.1","mock-fs":"^2.7.0","sqlite3":"^3.0.5","istanbul":"^0.3.13","coveralls":"^2.11.2","typescript":"^1.5.0-beta"},"_npmOperationalInternal":{"tmp":"tmp/careen_0.1.1_1638999726945_0.5051862754244294","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-12-08T21:42:06.871Z","modified":"2025-05-06T23:12:07.347Z","0.1.1":"2021-12-08T21:42:07.072Z"},"bugs":{"url":"https://github.com/programble/careen/issues"},"author":{"url":"http://cmcenroe.me","name":"Curtis McEnroe","email":"curtis@cmcenroe.me"},"license":"ISC","homepage":"https://github.com/programble/careen","keywords":["sql","schema","migration"],"repository":{"url":"git+https://github.com/programble/careen.git","type":"git"},"description":"SQL schema migration. Nothing more. Nothing less.","maintainers":[{"email":"infrastructure@bocoup.com","name":"robocoup"},{"email":"mike@mikepennisi.com","name":"jugglinmike"},{"email":"chris@bocoup.com","name":"chris_bocoup"}],"readme":"# Careen\n\n[![npm Version](https://img.shields.io/npm/v/careen.svg)](https://www.npmjs.com/package/careen)\n[![Build Status](https://img.shields.io/travis/programble/careen/typescript.svg)](https://travis-ci.org/programble/careen)\n[![Coverage Status](https://img.shields.io/coveralls/programble/careen.svg?style=flat)](https://coveralls.io/r/programble/careen?branch=master)\n\nSQL schema migration. Nothing more. Nothing less.\n\n## Feature Overview\n\n- Applies raw SQL file migrations.\n- Tracks both migration apply and revert operations in a journal table.\n- Supports SQLite3 and PostgreSQL.\n\n## Install\n\n```sh\nnpm install careen\n\nnpm install sqlite\n# or\nnpm install pg\n```\n\n## Configuration\n\nCareen reads configuration from either `careen.js` or `careen.json` in the\ndirectory it is run from. All options can be specified in JSON except the\nmigration ID generation function.\n\nAn alternate configuration file can be specified with the `--config` or `-c`\noption.\n\n### Client\n\n- `client`:\n  - `name`: Name of the database client to use.\n  - `config`: Connection configuration to pass to the database client.\n  - `journalTable`: Name of the table to write migration journal to. Default\n    `schema_journal`.\n\n#### SQLite3 Example\n\n```json\n{\n  \"client\": {\n    \"name\": \"sqlite3\",\n    \"config\": {\n      \"filename\": \"database.sqlite\"\n    },\n    \"journalTable\": \"schema_journal\"\n  }\n}\n```\n\n#### PostgreSQL Example\n\n```json\n{\n  \"client\": {\n    \"name\": \"postgresql\",\n    \"config\": {\n      \"url\": \"postgres://localhost:5432/database\"\n    },\n    \"journalTable\": \"schema_journal\"\n  }\n}\n```\n\nAlternatively, see [node-postgres][pg-config] for all configuration options.\n\n[pg-config]: https://github.com/brianc/node-postgres/wiki/Client#new-clientobject-config--client\n\n### Files\n\n- `files`:\n  - `directory`: Directory containing migration SQL files. Default\n    `migrations`.\n\n```json\n{\n  \"files\": {\n    \"directory\": \"migrations\"\n  }\n}\n```\n\n## Commands\n\n### Create\n\n```\ncareen -C my-first-migration\n```\n\nCreate a new migration. An ID based on the current time will be prepended\nto the migration name, and the appropriate extension will be appended.\n\nCareen supports two types of migration files which can be used in unison. The\ndefault type is \"combined\". These migration files contain both the up and down\nSQL for a migration in a single file. The two sections are separated by a line\nof three or more hyphens, `---`, a valid comment line in SQL. For example:\n\n```sql\nCREATE TABLE people (first_name TEXT NOT NULL, last_name TEXT NOT NULL);\n---\nDROP TABLE people;\n```\n\nThe other supported type is \"split\" migration files, where the up and down SQL\nare each in separate files ending in `.up.sql` and `.down.sql`, respectively.\n\nTo create combined migration files, pass the `--combined` or `-u` option. To\ncreate split migration files, pass the `--split` or `-s` option.\n\nMigrations are created by copying template files, which can be specified with\nthe `--template`, `--up-template`, `--down-template` options.\n\n### Apply\n\n```\ncareen -A\n```\n\nApply migrations. The default behaviour is to apply all pending migrations\n(migrations that have never been applied or have been reverted) in a single\ntransaction.\n\nMigrations can be applied using different transaction methods:\n\n- `--all` or `-a`: Apply all migrations in a single transaction (all or none).\n- `--each` or `-e`: Apply each migration in a transaction (as many as possible).\n- `--dry` or `-d`: Always `ROLLBACK` the migration transaction.\n\nThe migrations to apply can be specified in several ways:\n\n- `--pending` or `-p`: Apply all pending migrations.\n- `--id` or `-i`: Apply a single migration by ID.\n- `--to` or `-t`: Apply migrations up to and including an ID.\n- `--number` or `-n`: Apply a number of pending migrations.\n\n### Revert\n\n```\ncareen -R\n```\n\nRevert migrations. The default behavior is to revert the most recently applied\nmigration in a single transaction.\n\nMethod options are the same for revert as for apply.\n\nThe migrations to revert can be specified in several ways:\n\n- `--number` or `-n`: Revert a number of recently applied migrations.\n- `--id` or `-i`: Revert a migration by ID.\n- `--to` ot `-t`: Revert applied migrations up to and excluding an ID.\n\n### Status\n\n```\ncareen -S\n# or\ncareen\n```\n\nRead migration files and schema journal to determine the status of each\nmigration. The possible migration states are `pending`, `applied`, `reverted`\nand `missing`.\n\nTo show the status of only a single migration, pass the `--id` or `-i` option.\n\n### Journal\n\n```\ncareen -J\n```\n\nRead the schema journal for apply and revert operations.\n\nTo show only journal entries for a single migration, pass the `--id` or `-i`\noption.\n\n### Migrations\n\n```\ncareen -M\n```\n\nList all available migrations.\n\nTo list the paths of each migration's files, pass the `--long` or `-l` option.\n\nTo list a single migration, pass the `--id` or `-i` option.\n\n## Example\n\nThe `example/sqlite3` directory contains a sample Careen configuration, SQLite3\ndatabase and migration files.\n\n## Advanced Configuration\n\nThe default command and default options for all commands can be configured. See\n`lib/config/structure.ts` and `lib/config/defaults.ts`.\n\n---\n\n> It's because of our plans, man<br>\n> All our beautiful, ridiculous plans<br>\n> Let's launch them like careening jet planes<br>\n> Let's crash all of our planes into the river<br>\n> Let's build strange and radiant machines<br>\n> At this Jericho, waiting to fall<br>\n\n## License\n\nCopyright © 2015, Curtis McEnroe <curtis@cmcenroe.me>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","readmeFilename":"README.md"}