{"_id":"@carnegietech/cqlmigrate","_rev":"1-49275bd3509831c1136966535b3b44bf","name":"@carnegietech/cqlmigrate","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.2":{"name":"@carnegietech/cqlmigrate","version":"1.0.2","author":{"name":"Carnegie Technologies"},"license":"Apache-2.0","description":"cqlmigrate tool","bin":{"cqlmigrate":"build/cqlmigrate"},"scripts":{"dist-clean":"rimraf build/ coverage/","lint":"tslint --project tsconfig.lint.json -c tslint.json","compile":"tsc && cp src/cqlmigrate build/","compile:production":"tsc -p tsconfig.production.json && cp src/cqlmigrate build/","start":"NODE_ENV=development npm-run-all dist-clean lint compile && node build/app.js","test":"NODE_ENV=testing mocha -r ts-node/register test/**/*.ts","copy:package":"cp -r yarn.lock package.json Dockerfile build/","docker:install":"cd build/ && yarn --production","docker:pack":"cd build && touch package.tar.gz && tar --exclude=package.tar.gz -zchf package.tar.gz .","docker:prebuild":"npm-run-all dist-clean compile:production copy:package docker:install docker:pack","docker:build":"yarn docker:prebuild && docker build -t cqlmigrate:latest build"},"devDependencies":{"@types/cassandra-driver":"^3.4.0","@types/convict":"^4.2.1","@types/fs-extra":"^5.0.2","@types/klaw-sync":"^1.1.3","@types/mocha":"^2.2.40","@types/moo":"^0.4.0","@types/node":"^12.12.14","@types/should":"^8.1.30","mocha":"^3.2.0","nodemon":"^1.11.0","npm-run-all":"^4.0.2","rimraf":"^2.6.1","should":"^11.2.1","should-http":"^0.1.1","ts-node":"^4.1.0","tslint":"^5.20.1","tslint-eslint-rules":"^5.4.0","tslint-microsoft-contrib":"^6.2.0","typescript":"^3.7.2"},"dependencies":{"cassandra-driver":"^3.2.2","convict":"^5.2.0","fs-extra":"^5.0.0","klaw-sync":"^3.0.2","moo":"^0.4.3"},"licenseText":"\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2019 Carnegie Technologies\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","_id":"@carnegietech/cqlmigrate@1.0.2","dist":{"shasum":"e5f311924ef6c114b09ca921d54f84aca6714271","integrity":"sha512-U8pfhYhHXSOEyHkkuzpn7xD9VGAADPKhhDitSKKg5cFQ9N0fGjRgSfK+WboZZNUuUsL2AzlPshcBdpwiRMtGPA==","tarball":"https://registry.npmjs.org/@carnegietech/cqlmigrate/-/cqlmigrate-1.0.2.tgz","fileCount":38,"unpackedSize":204784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDisvCRA9TVsSAnZWagAA5pQQAIXybcONscgZccNOKoXy\nnE8aSr27iJkZUMc6EHfHK2xdfL2/ttgRNhPkxgFAnHxuLYnroHkrnGL5gQcX\n08QBebe42MvJBYA0A82/t+qLZSPInr7A4IFhx39Xb2mjdHwfFkDNIbSL5/Cu\n2TAlsRyundxnnDBqt382qWx7/cnswQytnfDMDkaO0vFLNb2vl5/uh4fMQihq\n56U4/jdCPMc4aTzUdEW9RV9QFf9umTKZs1Hf4+RfGFihPT+v2eqRP+DVbQ5j\nMZsMWLDodzON3qFtwX0GKo4dFhbpRP//h8Mtko7ITQhNEUjlAz2ctqzwc6D3\nfcr6weQ2oCA0zMz8FEyD8nm9FXxkpGVMxmdrGTo0V0cgdAFFK8HUqq1UVI0b\n40xxPof8+9rMrRyLG95tSeJf8jeRdCvtbcA2wHeZ8Pk+388EhLU3jH8j8csV\nMXeoQYQhr1eLU/YCLsD2EA0KXtE7gmh18B268E3M8styOOU8q5wn7KcYP2mV\nlSRaSklsIFsaN5OZqQnZ/IDSKzbxMtSd176vskjHWrmpczM1erxkgWNgaKma\nXQE74dpH9NAI/pn6mj1aQbRDZUBrjzT/F/q7TPe8QCbxOOTiBNjS694IgtSt\ndTAyMLkludTgZMP+Yb7IZsJH3B/3ZjxUNtFOdxfthFmVEmXsaHTNF64yzsH1\n9dyO\r\n=lFHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2tSVNaZuZ4SczzLp49TD64fXTO7zliXn+3CZa1SPHfAiEAoDqghVR0I3Pwh+j7A/7lxRmobIGBT0nu/8lniX9QpHs="}]},"maintainers":[{"name":"robert-ostensen","email":"rob@profesh.boxacle.net"},{"name":"ahamstra-ctech","email":"ahamstra@carnegietechnologies.com"},{"name":"severnt","email":"severn-npm@xephris.net"},{"name":"pravalanicholas","email":"narmstrong@carnegietechnologies.com"}],"_npmUser":{"name":"severnt","email":"severn-npm@xephris.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cqlmigrate_1.0.2_1577986862702_0.5720051532212236"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-02T17:41:02.463Z","1.0.2":"2020-01-02T17:41:02.823Z","modified":"2022-04-04T21:58:28.684Z"},"maintainers":[{"name":"robert-ostensen","email":"rob@profesh.boxacle.net"},{"name":"ahamstra-ctech","email":"ahamstra@carnegietechnologies.com"},{"name":"severnt","email":"severn-npm@xephris.net"},{"name":"pravalanicholas","email":"narmstrong@carnegietechnologies.com"}],"description":"cqlmigrate tool","author":{"name":"Carnegie Technologies"},"license":"Apache-2.0","readme":"# cqlmigrate\n\nA tool for performing CQL migrations.\n\n## Environment Variables\n\nThe following cqlmigrate environment variables should be set\n\n`CQLMIGRATE_CASSANDRA_CONTACT_POINTS` - A space separated list of contact points for the Cassandra cluster\n\n`CQLMIGRATE_ROOT_MIGRATION_DIRECTORY` - The `{root}` directory path for your migrations. See below for the required\ndirectory layout (default = \"/schema\")\n\n`CQLMIGRATE_INIT_FILENAME` - The `{initFile}` to search for in the `{root}` directory (default = \"cqlmigrate.cql\")\n\n`CQLMIGRATE_KEYSPACE_BOOTSTRAP_FILENAME`- The `{bootstrapFile}` to search for in each `{keyspace}` directory. See\nbelow for the required directory layout (default = \"bootstrap.cql\")\n\nYou may also optionally set\n\n`CQLMIGRATE_MIGRATION_CLIENT_TIMEOUT_MS` - Timeout in milliseconds for applying a migration file (default = \"30000\")\n\n`CQLMIGRATE_DEBUG` - Enables/disables debug logging (default = \"false\")\n\n## Directory Layout\n\nThis tool assumes your cql files are laid out in the specific directory structure shown below. This tool was designed\nwith microservices in mind, where each service owns its own tables. You will find the directory structure has that in\nmind, but the tool should still function just fine for other system architectures.\n\nNote that the directory names do not change the tool's behavior at all. For example, you could technically make changes\nto keyspace `A` from migrations within a keyspace `B` folder. However, doing so would not be recommended as migrations\nare only guaranteed to run in order within their own service directory, and migrations from different service\ndirectories may run in parallel\n\n`{root}` - The root migration directory\n\n`{initFile}` - The init file. This file sets up the cqlmigrate keyspace and tables required by cqlmigrate. The file\nalready exists (`cqlmigrate.cql` in the root directory of this project), and should be copied into your root migration\ndirectory as is. This file can be modified in order to change replication strategies and factors.\n\n`{keyspace}` - A keyspace folder. There may be any number of these within the `{root}` directory. Each `{keyspace}`\ndirectory should have a file called `{bootstrapFile}`.\n\n`{bootstrapFile}` - The filename to search for in `{keyspace}` directory. These bootstrap files are applied before any\nmigrations and should be used to set up the keyspace.\n\n`{service}` - A service directory. There should be one of these for each service that has tables. The `{migration}`\nfiles go inside the service directory for whichever service owns the table the migration is for.\n\n`{migration}` - A migration file. Any number of these can exist in each `{service}` directory. These files must be\nnamed such that when sorted lexically they will be in the order that they should be applied in.\n\n```\n{root}/\n├── {initFile}\n└── {keyspace}/\n    ├── {bootstrapFile}\n    └── {service}/\n        └── {migration}.cql\n```\n\nAs an example:\n\n```\nkeyspaces/\n├── cqlmigrate.cql\n├── foo/\n│   ├── bootstrap.cql\n│   ├── serviceOne/\n│   │   ├── 0001-initial.cql\n│   │   └── 0002-someMigration.cql\n│   └── serviceTwo/\n│       └── 0001-initial.cql\n└── bar/\n    ├── bootstrap.cql\n    └── serviceTwo/\n        ├── 0001-initial.cql\n        └── 0002-someMigration.cql\n```\n\n## Usage\n\n### Install from npm\n\nWith npm\n\n```sh\nnpm install -g @carnegietech/cqlmigrate\n```\n\nor with yarn\n\n```sh\nyarn global add @carnegietech/cqlmigrate\n```\n\nAfter installing, cqlmigrate can be run with\n\n```sh\ncqlmigrate\n```\n\n### Compile it yourself\n\nClone the repo and run\n\n```sh\nyarn install\nyarn compile\n```\n\nAfter compiling, cqlmigrate can be run with\n\n```sh\nnode build/app.js\n```\n\n## How it works\n\nThe tool will first attempt to acquire a lock for migrations. If this fails, we assume someone else is modifying\nschemas and exit.\n\nNext, it will load all of the bootstraps and migrations it finds in the directory structure laid out above.\n\nThe tool then starts applying migrations in \"rounds\". During each round of migrations, the tool finds the next\nmigration (sorted lexically) for each service, and applies that migration for each service in parallel. As an example,\nif your migrations were all prefixed with numbers such as `0001`, `0002`, `0003`, etc., then the `0001` files from\nevery service directory will be applied in parallel. Once each round of migrations has been applied (such as all `0001`\nfiles), the tool waits for all nodes to report in with the same schema. It will then move on to the next round using the\nnext available migration for each service.\n\nIf the tool finds that a migration has already been applied then it will skip it. If it finds a migration that failed\npreviously, it will exit with an error. If applying a migration fails, it will also exit with an error.\n\nAny time the tool exits with an error, you will be able to find the migration that failed by checking the\n`cqlmigrate.migrations` table. The failed migration, will have the `success` column set to `false`. Whenever possible,\nthe tool will try to provide meaningful logs about what went wrong.\n\nAfter successfully applying all migrations, or after an error, the tool will attempt to release the lock. If for some\nreason the tool is not able to release the lock, it will need to be manually removed from the `cqlmigrate.locks`\ntable.\n\n## Example\n\nAn example set of migrations including the init file, keyspace bootstrap files, and service migrations can be found in\nthe `example` directory. Assuming a Cassandra node is available at `localhost:9042`, the example can be run with\n\n```\nCQLMIGRATE_CASSANDRA_CONTACT_POINTS=\"localhost:9042\" \\\nCQLMIGRATE_ROOT_MIGRATION_DIRECTORY=./example \\\n    node build/app.js\n```\n\n## Tests\n\nTests can be run with\n\n```\nyarn test\n```\n\n## Docker Image\n\nA base Dockerfile is provided in the root of this repository. The image can be built with `yarn docker:build`, which\nbuild an image with the tag `cqmigrate:latest`. If you want to use a different tag then you can use the package prebuild\nscript and then run docker build manually:\n\n```sh\nyarn docker:prebuild\ndocker build -t <YOUR TAG> build\n```\n\nThe Dockerfile does not set any environment variables or provide migration mounts. Those configurations will need to be\nset by modifying/extending the Dockerfile or through some other means such as Kubernetes.\n\n## Error Cases\n\nUnfortunately, there are a number of things that can go wrong during a migration, and some of them will require manual\nintervention.\n\n### The Lock Table\n\nAs mentioned in the Usage section, cqlmigrate will first acquire a lock by inserting a row into the `cqlmigrate.locks`\ntable. If a row already exists, then cqlmigrate will not be able to acquire a lock. If you try running the tool and it\nfails saying that it couldn't acquire the lock, that could mean one of two things:\n\n1. Another instance of the tool is already running. This is probably an issue in your deployment process.\n2. The tool previously ran but was not able to shut down gracefully. This almost certainly means that the previous run\nfailed.\n\nIf you find yourself in bullet #2, then you should check the logs of your previous run to find out what went wrong.\n\nThe tool will always try to release the lock before shutting down, even in the case of a migration error.\n\n### Schema Consistency\n\nAfter performing any operations that change the schema, the tool will block until all nodes in the Cassandra cluster\nagree on what the schema is. This means that if any nodes are down (temporarily or permanently), then the nodes will\nnever be in agreement until the down node is brought back up or removed from the cluster. If the tool gets stuck on\nthe \"waiting for schema agreement\" phase for a long time, you may have run in to this issue.\n\nN.B. Scaling down using kubernetes will only set the removed node as \"down\", and does not remove it from the cluster.\nTo remove a node from the cluster, you need to use `nodetool`.\n\n### Mismatched Checksums\n\nWhen cqlmigrate applies a migration, it stores a checksum of the canonical file that was applied. On all future runs,\nit will make sure that all applied migration files still have the same checksum. If it finds any that don't match, it\nwill log an error stating which file didn't match, and then exit.\n\nNote that since the checksum is calculated after canonicalizing, you can still make some minimal changes to migration\nfiles. The canonicalization process removes excess whitespace, linebreaks, and comments. This means that you should be\nto safely change any of those things and still get the same checksum. Keep in mind that we don't change the case of any\nkeywords or identifiers, so while they are generally case insensitive, changing them will cause the file to hash\ndifferently.\n\n### Other Errors\n\nThere are other non-specific places an error could come from. Primarily these would be errors reading from or writing to\nCassandra. When these errors occur and can't be handle by the tool, it will log the best message it can (usually just\nthe error message that was thrown) and then exit.\n\n### Recovery\n\nWhen these errors happen during a migration, the failed migration(s) will show `success` = `False` in the\n`cqlmigrate.migrations` table. If you run the tool again with any failed migrations in the `migrations` table, it\nwill print an error and exit. This means you'll need to manually recover by the following steps\n\n1. Make sure cqlmigrate is no longer running. There is a slim chance you will need to clear `cqlmigrate.locks`, if\ncqlmigrate gets killed for some reason at a time when it has a lock\n2. Delete the failed migration(s) from `cqlmigrate.migrations`\n3. If any of the failed migration(s) did run, you will have to revert any changes it made (i.e. drop any tables it\ncreated).\n4. Fix the failed migration files\n5. Run cqlmigrate again\n\nThere is another case that could happen besides a bad migration, which is a migration being renamed and modified. In\nthis case, the steps are a bit different:\n\n1. Make sure cqlmigrate is no longer running. There is a slim chance you will need to clear `cqlmigrate.locks`, if\ncqlmigrate gets killed for some reason at a time when it has a lock\n2. Delete the `cqlmigrate.migrations` row related to the original filename\n3. Delete the `cqlmigrate.migrations` row related to the new filename\n4. Revert any changes made by either of the files (i.e. drop any tables created)\n5. Run cqlmigrate again\n\nIf you know that a file has been renamed and modified before running cqlmigrate, you can skip step 2, and the half of\nstep 3 related to the new file.\n","readmeFilename":"README.md"}