{"_id":"@brixtol/fauna-migrate","_rev":"5-2227cfa6fcd5a429cc98e09bde356474","name":"@brixtol/fauna-migrate","dist-tags":{"latest":"0.1.3-beta.1"},"versions":{"0.1.0-beta.1":{"name":"@brixtol/fauna-migrate","version":"0.1.0-beta.1","keywords":["faunadb","migration","database","fauna","serverless"],"author":{"url":"https://brixtoltextiles.com","name":"Νίκος Σαβίδης","email":"n@brixtol.com"},"license":"MIT","_id":"@brixtol/fauna-migrate@0.1.0-beta.1","maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"homepage":"https://github.com/brixtol/fauna-migrate#readme","bugs":{"url":"https://github.com/brixtol/fauna-migrate"},"bin":{"fauna-migrate":"bin/fauna-migrate"},"dist":{"shasum":"d2078596ea3f64df82c730ca0c63f21b7f1ca136","tarball":"https://registry.npmjs.org/@brixtol/fauna-migrate/-/fauna-migrate-0.1.0-beta.1.tgz","fileCount":19,"integrity":"sha512-JrcaNZ6aCvIIarz11Jiu0AJNE0pUFCPOLApjacbMFh6pu11lIzvA4Z0S5IjAoWaytt857mwQGgZVSWYJG3A56w==","signatures":[{"sig":"MEQCIDutRPFaQu3wHdlcbxzeMrBfXyKhwFRUncY40rrb/5YWAiAXmm2n/pp397TXGNIOLvFGPrCCEIe8eelMhwBF8WEKKA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhIbg7CRA9TVsSAnZWagAAwEAP+QEqRhPhqhhbMyFOSqwh\nDsk3yv8gd9RubntX8rDuOMifbP20JztZ1GnCaPcZjyd7Wkqj27xJQLzDFur6\n7kVZKHM7u+aDyBg+eu1WZzwYOPlBjiAeuHTeznc1XmTJ6867Fy4eKbIe/5aA\ng478Vn0oij59MvdvSL3Mci0Nhj5dvJqyjwFVXeJeqkfOg06l6N62MHEUoA58\n3yS9bOv54P4f9ef7ms9YP6McGZukCw1XcvLftuPcehKyH3iG+RBDTttTsz+Q\nvXCqRhvsjmmlLZAupFJdzEfvFUC/HbgKhrFClAHEP2O8/8d9y7A28t23JnnN\nmigOFMf9mU6/FN+5sce8NQnCxc03qLlfwgWkkjhDKv0M9aAwyLp5ca3H71La\nDLQbX0VoCDdfMnSA3ZyKmEDG/Sw+uJsHogGKLnIfymiO8lJoBXscX3xX6SXl\nqG5nhD4I/pvvayCyFm2JIPfb/tfAeDw7W5e2QvngIjSUAyb5BrNbBmiaiqnJ\naluD+c+9rz/wrjS0yEmxnRM3LRnylCI/8KZamSkFQYNK8sjBhd8eX47oCPHk\n+1MS0Qyp4GyH+od3SBjfM1uQPAE/aM1OTX+dijKxT6P3r8ttC8mB8GQUFpab\n8yYhLIdhTBlz8aMX31txObXAoJdvh3UXiiMQQg7KF9LhnQZ7HFSLV405X2ZR\nk/bh\r\n=OVNQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./package/index.js","_from":"file:brixtol-fauna-migrate-0.1.0-beta.1.tgz","types":"./package/@types/index.d.ts","engines":{"pnpm":">=5"},"exports":{"require":"./package/index.js"},"scripts":{"dev":"rollup -c -w","test":"ava --watch --verbose","build":"rollup -c --environment prod","package":"cd versions; pnpm pack ../ && cd ..","fauna-migrate":"./bin/fauna-migrate"},"_npmUser":{"name":"sissel","email":"nicos.savidis@gmail.com"},"_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/brixtol/fauna-migrate.git","type":"git"},"_npmVersion":"6.14.13","description":"A migration helper utility for populating a serverless Fauna database.","directories":{},"_nodeVersion":"14.17.0","dependencies":{"ora":"^5.4.1","chalk":"^4.1.2","minimist":"^1.2.5"},"eslintConfig":{"extends":"@brixtol/eslint-config-typescript"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","rollup":"^2.56.2","faunadb":"^4.3.0","typescript":"^4.3.5","@brixtol/tsconfig":"^1.0.0","rollup-plugin-terser":"^7.0.2","@brixtol/rollup-utils":"^0.2.0","rollup-plugin-filesize":"^9.1.1","@rollup/plugin-commonjs":"^20.0.0","rollup-plugin-typescript2":"^0.30.0","@brixtol/eslint-config-typescript":"^1.0.0"},"peerDependencies":{"faunadb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/fauna-migrate_0.1.0-beta.1_1629599803294_0.9480748748229508","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1-beta.1":{"name":"@brixtol/fauna-migrate","version":"0.1.1-beta.1","keywords":["faunadb","migration","database","fauna","serverless"],"author":{"url":"https://brixtoltextiles.com","name":"Νίκος Σαβίδης","email":"n@brixtol.com"},"license":"MIT","_id":"@brixtol/fauna-migrate@0.1.1-beta.1","maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"homepage":"https://github.com/brixtol/fauna-migrate#readme","bugs":{"url":"https://github.com/brixtol/fauna-migrate"},"ava":{"files":["test/cli/lines.js"],"require":["esm"],"concurrency":5},"bin":{"fm":"bin/fauna-migrate.js","fauna-migrate":"bin/fauna-migrate.js"},"esm":{"cjs":true},"dist":{"shasum":"5a6497b6c4c104dfdd34d146416ad9246e639172","tarball":"https://registry.npmjs.org/@brixtol/fauna-migrate/-/fauna-migrate-0.1.1-beta.1.tgz","fileCount":20,"integrity":"sha512-OC4VrEB/spDiuiUKPlSmxrMxOBT0E/cWFweWE8b4sX3Rov1R9Q12BkZTI3gH3jWyIfMj/DtCcNFq7IgTrQ5T5A==","signatures":[{"sig":"MEUCIQDJbKKtpiJAUFxVyFJukUyJQWnMtEsexesFxRg/YB7nqgIgaF9thFpqf9Gr2xiN1JTCQ67JVw+D4kNtxebHxPo+1jo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKaeGCRA9TVsSAnZWagAAPWAP/iOGs9NeP7i+l1EK+Xkn\n9vP1UfsyIX6FFgG8d1Mkn6GvFqVXhjT8nQJxDdpnBFl6vX235Ro1eOD1VA5o\nfRRK9dBhjqr5DeTnQV7PepKvNKMAspRiKKWWeOdMz2rH4mVJWDy2DK7swu7b\nayBcChwdrvZ53Lop6GowFdoW6+LEMS6+vC8QWu6BY9bhl1FjmoBmJ+UeO5V0\nMD/X5AuJOarAviU3z9nom+AHOJtJpERpxORpBsqs/DjazklQSKmMOCVHg8IM\n57yMh3xrCVOA5jTpxH7ybrlM0LbobNHZ1saBIk7BKw7o0JUXnUatD06BZSAC\nNpSNK2rq+wB+p9a0LBrgLS4mTBpdhK5XNln7nlSN5RwE4AuB4AazK2YcZds0\nqtW8Z+97Xx4RZ6vtptuPqNe2HTW/qW24VPB2pse2MGr7U2RyzSqeSkNh+D5i\nDT1hrmAbN54XvzUJKHToixQ0qGHKaYiVEMIrvcZwk1jmWkC7NUA+O65zxtD9\nqWFUgOfTsI5inwc2fN5O6luqDxSf1EOqNZlsjbi/onRsV+T7UZWk6Akyh/AX\n4ySJ1REpszrLowWJcuQ2X2oA6XeoliZbbdda50FGg7ax2a3WQio7UB/p48fh\nNvRK+cQes2eEthdUtuEjFoP73jsxVcuShuHIJSwaG9SzyR4eiEiluxkLy+wW\ni2/e\r\n=7YLO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./package/index.js","type":"module","_from":"file:brixtol-fauna-migrate-0.1.1-beta.1.tgz","types":"./package/@types/index.d.ts","engines":{"node":">=14","pnpm":">=6"},"exports":"./package/index.js","scripts":{"fm":"./bin/fauna-migrate.js","dev":"rollup -c -w","test":"ava --watch --verbose","build":"rollup -c --environment prod","package":"cd versions; pnpm pack ../ && cd ..","fauna-migrate":"./bin/fauna-migrate.js"},"_npmUser":{"name":"sissel","email":"nicos.savidis@gmail.com"},"prettier":"@brixtol/prettier-config","_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/brixtol/fauna-migrate.git","type":"git"},"_npmVersion":"6.14.13","description":"A migration helper utility for populating a serverless Fauna database.","directories":{},"_nodeVersion":"14.17.0","dependencies":{"ora":"^6.0.0","chalk":"^4.1.2","minimist":"^1.2.5"},"eslintConfig":{"extends":"@brixtol/eslint-config","ignorePatterns":"package"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","faunadb":"^4.3.0","typescript":"^4.4.2","@brixtol/tsconfig":"^1.0.1","@brixtol/eslint-config":"^1.0.1","@brixtol/rollup-config":"^1.0.0","@brixtol/prettier-config":"^1.0.3"},"peerDependencies":{"faunadb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/fauna-migrate_0.1.1-beta.1_1630119814082_0.2842420630564826","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.2-beta.1":{"name":"@brixtol/fauna-migrate","version":"0.1.2-beta.1","keywords":["faunadb","migration","database","fauna","serverless"],"author":{"url":"https://brixtoltextiles.com","name":"Νίκος Σαβίδης","email":"n@brixtol.com"},"license":"MIT","_id":"@brixtol/fauna-migrate@0.1.2-beta.1","maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"homepage":"https://github.com/brixtol/fauna-migrate#readme","bugs":{"url":"https://github.com/brixtol/fauna-migrate"},"ava":{"files":["test/cli/lines.js"],"require":["esm"],"concurrency":5},"bin":{"fm":"bin/fauna-migrate.js","fauna-migrate":"bin/fauna-migrate.js"},"esm":{"cjs":true},"dist":{"shasum":"0746fb9cfcef9fff69247a0181c240e0b6c40d12","tarball":"https://registry.npmjs.org/@brixtol/fauna-migrate/-/fauna-migrate-0.1.2-beta.1.tgz","fileCount":20,"integrity":"sha512-nO2NBEE3aS3uttpoWnv7qrI5TXyulRMKnlGo/Svkck5vS5TdF2WwcjHBHjxF1tV2iCPsUwnl/ts+TaBvM0/9kQ==","signatures":[{"sig":"MEUCIDlg8GqeV3bvLs10MjHel1K8gvTeVkM42nW/0i0HxzGjAiEAyzU64DTvmEvB4YqRzviSUUtB2E3XKilrAw/+WWKLGe4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36306,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKbHcCRA9TVsSAnZWagAAj6YP/Rjvo2zKVjvE3Betjpmy\nme5jQehqngRU0n9UZxGsfx20kqHNLWFxvcISQJmNP76kbhSMyS/6LkvaX0TN\n/DDzc+bwYeQynARQUaxYlx5MYJ7X4C6FXLWVDwygp3BswjU1qy2qkMJp4954\nH0/QeK9osdKhbBFPIYbiOgXBj1Gzb6blKgQJvMmxORJCnTM0cZaNXXCRjgth\n/ehC9/t6cnAoAU+/hUPJAW2VZY8WtemfsK1r8JX6VgVsZeUuV/x1G5bUG9ef\ntjSt6axJXRMbIVySjWYSmE/BPHY9g6ajr142MlaB4+Tnku3N7/kBS9p0dqxP\n2PfQDw9h52B7hf3exnVqJZG9gS7cYui5k++OTWzGhPpK/95eI+uq5G7osR9P\nBOu7OJwxwhCWXT6GkchAfKvZnKqQc3qatlAlZgAlWhhRuS4p4JK/dJtClVoW\nng20S1qO/sb4iJt15K3swxlVLqxJuesstYpJY1IpZ36Akv1hxbkXKygCDXQw\nYB7WVKeZL+EBpQDzY/RVi/bUvnPkPQKs0jG8PTKHvmtBJ9M9EZOpQGjInR80\nOofEVWeIqG/megsRXX+U8NVbIO/5pLOMQ7x26b2XAHZvmDvFASxVUzuQqPOQ\nusm3yooDN6ctcNb1WSI2kqHSkFAu47j8do+EcvCae+fGKLmD0Jguhl6IvMpo\nzUVL\r\n=j1+X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./package/index.js","type":"module","_from":"file:brixtol-fauna-migrate-0.1.2-beta.1.tgz","types":"./package/@types/index.d.ts","engines":{"node":">=14","pnpm":">=6"},"exports":"./package/index.js","scripts":{"fm":"./bin/fauna-migrate.js","dev":"rollup -c -w","test":"ava --watch --verbose","build":"rollup -c --environment prod","package":"cd versions; pnpm pack ../ && cd ..","fauna-migrate":"./bin/fauna-migrate.js"},"_npmUser":{"name":"sissel","email":"nicos.savidis@gmail.com"},"prettier":"@brixtol/prettier-config","_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/brixtol/fauna-migrate.git","type":"git"},"_npmVersion":"6.14.13","description":"A migration helper utility for populating a serverless Fauna database.","directories":{},"_nodeVersion":"14.17.0","dependencies":{"ora":"^6.0.0","chalk":"^4.1.2","minimist":"^1.2.5"},"eslintConfig":{"extends":"@brixtol/eslint-config","ignorePatterns":"package"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","faunadb":"^4.3.0","typescript":"^4.4.2","@brixtol/tsconfig":"^1.0.1","@brixtol/eslint-config":"^1.0.1","@brixtol/rollup-config":"^1.0.0","@brixtol/prettier-config":"^1.0.3"},"peerDependencies":{"faunadb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/fauna-migrate_0.1.2-beta.1_1630122460189_0.8222285276930359","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.3-beta.1":{"name":"@brixtol/fauna-migrate","version":"0.1.3-beta.1","keywords":["faunadb","migration","database","fauna","serverless"],"author":{"url":"https://brixtoltextiles.com","name":"Νίκος Σαβίδης","email":"n@brixtol.com"},"license":"MIT","_id":"@brixtol/fauna-migrate@0.1.3-beta.1","maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"homepage":"https://github.com/brixtol/fauna-migrate#readme","bugs":{"url":"https://github.com/brixtol/fauna-migrate"},"ava":{"files":["test/cli/lines.js"],"require":["esm"],"concurrency":5},"bin":{"fm":"bin/fauna-migrate.js","fauna-migrate":"bin/fauna-migrate.js"},"esm":{"cjs":true},"dist":{"shasum":"8f1ba9676099b1f26629ba84c89d540c9cec6722","tarball":"https://registry.npmjs.org/@brixtol/fauna-migrate/-/fauna-migrate-0.1.3-beta.1.tgz","fileCount":20,"integrity":"sha512-vKB7Uln87QHVeVofHbwvjEVhmpv88rIJ03kUaK50gI9gfRbaSFwAUIwgTU/1ema7cKikIgRqk9W0qg8eWrqzVA==","signatures":[{"sig":"MEUCIQDQBQRKen3waqL9V4LOWtO0cBdFOH9t3wFfwSq/mx7YAAIgGomWzUxyfQhoiCrYGkGulOPccgZ9lRm/jnJm0LUf/lo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhKbndCRA9TVsSAnZWagAAxWwQAIWlWVjA85OA+8nTjwOl\nYEx3bcRsSDEjQu0L1MgR/1ghIR14Kyzva0gfaYRdAq1ljj8f2Uflltb0lXoR\nPPGi0e4QgbeFmbl0pt9qJ7P11/VfMnXK4kR/+y6o0wJFlS+CCMTLksHPriQp\nuBCW/hxCDVK/wCAtXb97lv7c41dfyjE9DHcRQ6jaT6Y2xTO6nK0UMN3Jp0fh\n4Knc3+s6zyO9Ml3Me3YZjb2rom0IxrR8MRVdp6fE8S48AvBkvueuzjVzGSgR\ns5TVhxh4GEbo946PbGzGdJFPOyxyqx0FimG1x1YkE5TY5zhANl3yOGfE5Hfw\nIQopn4rkldZQ4xJdpIciYs7wAj1MwsH9x7FzwlWfpNSjb636VXNxYjztQsIT\nqWOQjv9P8gqiXs2OlDqIDtHMlsMdqpS8e6sCnMfD8jYs0cTZGl/fLSDsP2gQ\n0LZ+rbDxwqNpeCgnUH5I5SOAyhlTE60+PxcQPoZZPu9ViWDn9ng0umvUXVF3\nH4OU5aQIty1LbN5LkhnKr+hq47FvaX0P0D6rigbTw9W51TIahQRVCMfGFZ8f\nGUbMce6Bn8B9OmvPWjxiZWRrKMFmdqTKBkfgXNw5k1lzDwPm1Zkqu22lFska\nrPMNSzONDi1sQiwuQIph/QwhocwpT+YPNn8IU2GS2S4uL6u+xefAhN96xktZ\nYpwH\r\n=1PCo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./package/index.js","type":"module","_from":"file:brixtol-fauna-migrate-0.1.3-beta.1.tgz","types":"./package/@types/index.d.ts","engines":{"node":">=14","pnpm":">=6"},"exports":"./package/index.js","scripts":{"fm":"./bin/fauna-migrate.js","dev":"rollup -c -w","test":"ava --watch --verbose","build":"rollup -c --environment prod","package":"cd versions; pnpm pack ../ && cd ..","fauna-migrate":"./bin/fauna-migrate.js"},"_npmUser":{"name":"sissel","email":"nicos.savidis@gmail.com"},"prettier":"@brixtol/prettier-config","_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/brixtol/fauna-migrate.git","type":"git"},"_npmVersion":"6.14.13","description":"A migration helper utility for populating a serverless Fauna database.","directories":{},"_nodeVersion":"14.17.0","dependencies":{"ora":"^6.0.0","chalk":"^4.1.2","minimist":"^1.2.5"},"eslintConfig":{"extends":"@brixtol/eslint-config","ignorePatterns":"package"},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.2.25","faunadb":"^4.3.0","typescript":"^4.4.2","@brixtol/tsconfig":"^1.0.1","@brixtol/eslint-config":"^1.0.1","@brixtol/rollup-config":"^1.0.0","@brixtol/prettier-config":"^1.0.3"},"peerDependencies":{"faunadb":"^4.3.0"},"_npmOperationalInternal":{"tmp":"tmp/fauna-migrate_0.1.3-beta.1_1630124509338_0.343116596940336","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2021-08-22T02:36:43.221Z","modified":"2024-10-31T20:14:02.424Z","0.1.0-beta.1":"2021-08-22T02:36:43.432Z","0.1.1-beta.1":"2021-08-28T03:03:34.438Z","0.1.2-beta.1":"2021-08-28T03:47:40.341Z","0.1.3-beta.1":"2021-08-28T04:21:49.470Z"},"bugs":{"url":"https://github.com/brixtol/fauna-migrate"},"author":{"url":"https://brixtoltextiles.com","name":"Νίκος Σαβίδης","email":"n@brixtol.com"},"license":"MIT","homepage":"https://github.com/brixtol/fauna-migrate#readme","keywords":["faunadb","migration","database","fauna","serverless"],"repository":{"url":"git+https://github.com/brixtol/fauna-migrate.git","type":"git"},"description":"A migration helper utility for populating a serverless Fauna database.","maintainers":[{"name":"sissel","email":"nicos.savidis@gmail.com"}],"readme":"# @brixtol/fauna-migrate\n\nA migration CLI helper utility for populating [FaunaDB](https://fauna.com/) databases and in addition provides seeding capabilities.\n\n> GraphQL is not supported, this module is developed for FQL.\n\n# Install\n\nThis module has a peer dependency on the [faunadb](https://www.npmjs.com/package/faunadb) JavaScript driver, please ensure you have it installed. Also, it is probably worth noting that this is an [ESM](https://nodejs.org/api/esm.html) module.\n\n```cli\npnpm add @brixtol/fauna-migrate --save-dev\n```\n\n> Because [pnpm](https://pnpm.js.org/en/cli/install) is dope and does dope shit.\n\n### Fauna Secret\n\nSupply your fauna secret key in a `.faunarc` file. The `.faunarc` file must exist in the root directory of your project.\n\n```env\nFAUNA_KEY = secret\n```\n\n> If you are using the [fauna vscode extension](https://marketplace.visualstudio.com/items?itemName=fauna.fauna), you may already have this file.\n\n# Directory Structure\n\nThe following is the assumed (default) directory structure that is resolved from a projects cwd where fauna-migrate has been installed. The below example attempts to depict what is typical in a website/blog and show how one _might_ construct something like this.\n\n> Please note that the `functions` directory and the `config.json` config file are both optional and not required. There is no enforced pattern to how one should structure their migrations when using fauna-migrate.\n\n```\n├── db\n│   ├── migrations\n│   │   ├── users.js\n│   │   ├── articles.js\n│   │   ├── comments.js\n│   │   └── pages.js\n│   │\n│   ├── functions\n│   │   ├── get_all.js\n│   │   ├── set_date.js\n│   │   └── find_word.js\n│   │\n│   ├── seeds\n│   │   ├── articles.js\n│   │   └── pages.js\n│   │\n│   └── config.json\n│\n└── .faunarc\n```\n\n# CLI\n\nThe module provides a basic cli for executing the migrations. You should avoid installing fauna-migrate globally due to its peer dependency on [faunadb](https://www.npmjs.com/package/faunadb). It is better to reference the commands within your projects `package.json` scripts.\n\n### Commands\n\nBy default, fauna-migrate will call `up` and accepts either `up`, `down`, `seed` or `help` as first argument commands, these instruct the module on what action it should preform. An optional `run` argument can be passed which informs upon a directory to run within your migrations `db` directory, this can be either `migrations` (`m` for short) or `functions` (`f` for short).\n\nThe CLI accepts a couple flags and provides some additional features:\n\n```cli\nAliases:\n  fauna-migrate  You can also call this instead in-place of fm\n\nCommands:\n  fm up   <run>  Executes full migration, skips existing (default)\n  fm down <run>  Reverses a migration, and will remove data records\n  fm seed        Seeds a collection with some local referenced data\n  fn help        Prints command list information (same as -h and --help)\nOptions:\n  m, migrations <flags>  Run on migrations directory\n  f, functions  <flags>  Run on functions directory\n\nFlags:\n  -c, --config  Run migrations from a config.json config file\n  -h, --help    Prints command list information (same as fm help)\n  -d, --dir     <path>  Define a custom directory for migrations\n  -i, --input   <list>  A comma separated list of migrations to run\n\nDanger Zone:\n  --force   Force migration, deletes collection then re-migrates\n            BEWARE! Using force will remove data from your database.\n```\n\n> Please be cautious when using the `--force` flag, it will delete collections before re-creating them. It's dangerous and once passed there is no turning back, ie: you are fucked.\n\n### Examples\n\nThe below command will execute a migration (creation), as mentioned the CLI will default calls to `up` so it can be omitted. We have passed a runner argument of `m` which infers that we only wish to run files located in the `migrations` directory. We have also passed a `--dir` flag and provided a value of `database`, this infers that our migrations are contained within a directory named `database` (instead of the default `db`). The command will read all files located in `database/migrations`.\n\n```cli\nfm m --dir database\n```\n\nThe below command will execute a forced migration. This is a dangerous call and needs to be used with caution because it will delete all migrations before re-creating them. Fauna has a 60 second time limit enforced, the CLI will show a timer upon deletion and once the time limit has complete it will continue execution.\n\n```cli\nfm up --force\n```\n\nThe below command will execute a forced migration on 2 migrations contained within the `migrations` directory that have a filename of `bar.js` and `foo.js` which we have provided following the `-i` (short for `--input`) flag which allows us to select specific files within a defined runner directory. We also passed the `--dir` flag and again, as our previous example show, it informs that our migrations are located within `src/db/migrations`.\n\n```cli\nfm up m --dir src/db -i foo,bar --force\n```\n\n### Scripts\n\nIn your projects `package.json` file, create scripts in order to run migrations via the CLI. Use a clear and concise namespace pattern for this, for example:\n\n```json\n{\n  \"scripts\": {\n    \"db:up\": \"fm up\",\n    \"db:down\": \"fm down\",\n    \"db:functions\": \"fm up f\",\n    \"db:seed\": \"fm seed\"\n  }\n}\n```\n\n> Remember if you need to separate arguments in a node env, use triple dashes, eg: `---` this will help prevent fauna-migrate commands from being ran as executables.\n\n### Config File\n\nMigrations can be executed according to a custom configuration. This is how we here at [Brixtol](https://brixtoltextiles.com) handle our migrations. You will need to pass the `-c` or `--config` flag in order to enable this and can optionally provide a config path (file). If the config path is unspecified fauna-migrate defaults to `db/config.json`.\n\n> Please note that in order to use a config file, you must explicitly pass the `-c` or `--config` flag otherwise the `config.json` config file will be ignored.\n\n```ts\nimport { config } from \"@brixtol/fauna-migrate\";\n\nexport default config({\n  migrations: [\"filename\"],\n  seeds: [\"filename\"],\n  functions: [\"filename\"],\n});\n```\n\n### Creating Migrations\n\nMigrations are just basic objects. Each migration requires a `Collection` reference be provided. You can also generate indexes and functions on the migration using the `Indexes[]` or `Functions[]` options. Below we are creating a `products` collection migration and in addition creating both indexes and functions for interacting with its data entries.\n\nWe will name this file `products.js` and place it in the `db/migrations` directory, relative to our cwd root. When we are defining a migration that is creating a collection, it is good practice to keep these files in one place.\n\n> All migrations have detailed typings with JSDoc annotations to describe using the same information found within FaunaDB documentation.\n\n<!-- prettier-ignore -->\n```typescript\nimport { migrate } from '@brixtol/fauna-migrate'\n\n// The q parameter is the faunadb client instance\nexport default migrate(\n  q => ({\n\n    /**\n     * Collection Migration\n     *\n     * This object is passed to the FQL `CreateCollection()` method.\n     */\n    Collection: {\n      name: 'products',\n      permissions: {\n        write: q.Collection('users')\n      }\n    },\n\n    /**\n     * Index Migrations\n     *\n     * Each object in the array is passed to the FQL `CreateIndex()` method.\n     */\n    Indexes: [\n      {\n        name: 'all_products',\n        source: q.Collection('products'),\n        permissions: {\n          read: q.Collection('users')\n        }\n      },\n      {\n        name: 'products_by_channel',\n        source: q.Collection('products'),\n        unique: false,\n        serialized: true,\n        terms: [\n          { field: [ 'data', 'channel', 'shopify' ] },\n          { field: [ 'data', 'channel', 'åhlens' ] }\n        ]\n      }\n    ],\n\n    /**\n     * Function Migrations\n     *\n     * Each object in the array is passed to the FQL `CreateFunction()` method.\n     */\n    Functions: [\n      {\n        name: 'get_product_by_channel',\n        role: 'admin',\n        body: q.Query(\n          q.Lambda(\n            'channel'\n            , q.Match(\n              q.Index('products_by_channel')\n              , q.Var('channel')\n            )\n          )\n        )\n      }\n    ]\n  })\n)\n```\n\n### Creating Functions\n\nFauna gives us the power of being able to compose functions. When working with complex datasets single file migrations like the one we created above can start to become extraneous and harder to maintain over time. Function migrations are helpful as we can provide Fauna function migrations as single file exports.\n\n> You may prefer to never write functions together with migrations and instead keep them isolated from one another. We tend to separate our function migrations from our collection and indexes migrations. There no enforced pattern here, do as you wish and be as you are.\n\n<!-- prettier-ignore -->\n```typescript\nimport { migrate } from '@brixtol/fauna-migrate'\n\n// The q parameter is the faunadb client instance\nexport default migrate(\n  q =>([\n    {\n      name: 'get_product_by_channel',\n      role: 'admin',\n      body: q.Query(\n        q.Lambda(\n          'channel'\n          , q.Match(\n            q.Index('products_by_channel')\n            , q.Var('channel')\n          )\n        )\n      )\n    }\n  ])\n)\n\n```\n\n### Creating Seeds\n\nSeeding is provided but needs a little extra work, you can take peek into the test/db directory to get a glance, but expect changes to come.\n\n# Known Issues\n\nThis module is in its infant stages and there may be some breaking changes until a major version release. The package is not perfect (yet), but should suffice for the vast majority of use cases. Below is some known issues and solutions of what you may encounter:\n\n### Regions\n\nFor now, the tool will only work with Classic [Regions](https://docs.fauna.com/fauna/current/api/fql/region_groups#limitations), so ensure your database is using classic.\n\n### Collection Sorting Order\n\nIf a migrations is referencing an unknown or yet to be generated collection, you will need to execute the migration call a second time because the CLI will execute in alphabetic order. You can use a `config.json` to infer a sorted execution order of migrations. This will be fixed in upcoming versions.\n\n### Persisted 60sec when using `--force` on combined migrations\n\nThis is a known bug, will be fixed in upcoming releases.\n\n### Iteratable Execution (Internal)\n\nThe module populates a fauna database in an iterable process. This is an internal aspect and something I am aware of (author here). This can be a little more elegant. When I first put this together I was coming off a heavy weekend of partying, so my mind was little cooked. In upcoming versions this logic will change and instead the faunadb driver `Do()` method will be leveraged.\n\n# Contributing\n\nContributions are welcome. This project has been open sourced by us but exists as part of a private mono/multi repository. If you wish to contribute, please use [pnpm](https://pnpm.js.org/en/cli/install).\n\n### License\n\nLicensed under [MIT](#LICENCE)\n\n---\n\nWe [♡](https://www.brixtoltextiles.com/discount/4D3V3L0P3RS]) open source!\n","readmeFilename":"readme.md"}