{"_id":"@becklyn/contentful-migrations","_rev":"16-16e9fee89308d9ebdafea11d4ea2c629","name":"@becklyn/contentful-migrations","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@becklyn/contentful-migrations","version":"0.1.0","author":{"name":"Marko S. Vujnovic","email":"mv@becklyn.com"},"license":"MIT","_id":"@becklyn/contentful-migrations@0.1.0","maintainers":[{"name":"keichinger","email":"kai.eichinger@outlook.com"},{"name":"jesko-plitt","email":"jp@becklyn.com"},{"name":"msvujnovic-becklyn","email":"mv@becklyn.com"}],"homepage":"https://github.com/Becklyn/contenful-migrations","bugs":{"url":"https://github.com/Becklyn/contenful-migrations/issues"},"bin":{"becklyn-contentful-migrate":"bin/migrate.js"},"dist":{"shasum":"6e03675f346a23ea559aebde84bdc91f33539479","tarball":"https://registry.npmjs.org/@becklyn/contentful-migrations/-/contentful-migrations-0.1.0.tgz","fileCount":9,"integrity":"sha512-SjxyxMxnXLErAXNRJL82KJyb3l4MKQsRlGJnVr87c1iQHLZ829nklaeTOj8tWDsUXs3LBdEXojWnRLDBgHeDZw==","signatures":[{"sig":"MEUCIHQZuqJRhhelXsvckSDLLiJ9Er1fZGgtknrZZykaUIR8AiEAhyhP4gAUWZyMTeEnAKwnofqawcu9qti2RTgM/j1FiG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhA/2TCRA9TVsSAnZWagAAorQQAIaRZHzEquNR3Cyys9j7\nZjePTQGBrc+xfao7wF2WiJLmtkVkEbFEXK6/MGnMlsTH/ysx/faCd9bz8B6V\ndOlqkgl3a3u0rzr/0Yl/eJDeHiQpN8lzvTc+dazwDEOIlfvoeTiR5b/wMzd1\nxHE4wmOoGwFQOfffr9z8Hdtwe/Lxh9ef4l5AC5NzXAXR/hiYVRlmXAAYdOz8\nzn4tgAtA1iZIzMH1u5Qwtgth754ETxkLdWmiL7gdgE2o+DIGHYiEmZMhxhzk\nN0topjqP6dJLWAM+yDeItrke1adFVZCY3BqYtxWez6sKTPNEC3aaUl48nHwV\nRGdYaFZdx75uev9h4RXVgSwK2lDSoAWCbIEF8Om1sULE3gTGxD1feL+hR1Z4\nd6PE7WRtsmaSoOikDh6sYahsOoux341J5W1o804GDVTZZbYrGpIi/npDTXki\nYmYskCceZKwWiOFJKfMk+wqoE2bcF2OXwAiIJOq3+lfZ13o6BQmgY+HtW0SY\nkYjIoR+zQSlrsyuzCcDThjG25nejHiL/wqOaFNRau7Vvtr1o/ZHigpT6htMo\n7o3wsSFmvOnRALxLJMLRCcG5v2QRORM1SvGB35TjJJwWSp2aCiqKVQ+lhMM8\n8giRPj/dv5fN0FjUQ7591Bj1w1hVc6hRyLEJ5bjr1HOWDZH/E6ZIR5HzpKaI\nhG8n\r\n=pC7s\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./bin/migrate.js","engines":{"node":">=8"},"gitHead":"2769019fe44192c0c3207887b1c908870e422b82","_npmUser":{"name":"msvujnovic-becklyn","email":"mv@becklyn.com"},"repository":{"url":"git+ssh://git@github.com/Becklyn/contenful-migrations.git","type":"git"},"_npmVersion":"6.14.11","description":"A tool for executing content model migrations in Contentful","directories":{},"_nodeVersion":"14.16.0","dependencies":{"contentful-cli":"^1.8.15","contentful-migration":"^4.2.3","contentful-management":"^7.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/contentful-migrations_0.1.0_1627651475229_0.33958368057940636","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@becklyn/contentful-migrations","version":"0.1.1","author":{"name":"Marko S. Vujnovic","email":"mv@becklyn.com"},"license":"MIT","_id":"@becklyn/contentful-migrations@0.1.1","maintainers":[{"name":"keichinger","email":"kai.eichinger@outlook.com"},{"name":"jesko-plitt","email":"jp@becklyn.com"},{"name":"msvujnovic-becklyn","email":"mv@becklyn.com"}],"homepage":"https://github.com/Becklyn/contenful-migrations","bugs":{"url":"https://github.com/Becklyn/contenful-migrations/issues"},"bin":{"becklyn-contentful-migrate":"bin/migrate.js"},"dist":{"shasum":"8d1dbe73118b502558c35950719eb20417c9effe","tarball":"https://registry.npmjs.org/@becklyn/contentful-migrations/-/contentful-migrations-0.1.1.tgz","fileCount":9,"integrity":"sha512-GDr+ilm7hK9eJRTdnJ4evxAJSOdWPn0GgBgmUv7zwWFgkIPcGdzzUlDkEMw64bwFfa6MUh7rw8eJVXPSNiRPxw==","signatures":[{"sig":"MEQCIHM2zG9WHVNj+TDnD4YDqczo+4buLe2ZoINbgtN7LbsgAiBPhAJh1NMcho7TBPCyx5BANxHmyPjPzhsMrN/wmIMjEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBADxCRA9TVsSAnZWagAAfS8P/21DFM+NMAwFcigaG+Kt\nny9H2C8aZACiee3uDpWsZYRQ4HMEqu6RUfdTswRrVxmD/t5NEQmFi0/DGE/a\njpgHdHykdXmRhZR2qkpgyLbtIv9LCSsI9kJLS7LucqpWixS0Yh+FuRY2/F+o\n72BJTTz0mfU/uSJl0AWw9Jc/f/BtPOl2Jwa6i6L9X8NlMGCCPbKGj/pqjt50\nOiMafh2uIqQMpnX2A6unJM9mAazGm5SpXa6fBaAYchURIWV16HleHClF/DJ/\nSfNWfxOrwA/ffcnWIgzFfPzARuxzcEz/oJv1skeVkYDxihvcW4IwOZ8dHXpC\n00btCruBAL61FYoiNlLbeKPtyTerMsquexk2smrlT2x6WtHJfSZcTcUE7pgH\nwpwrVDsImOiz8D48Xly+tpVfrvdOfCNgn5cc79f/GC+35K9qaVeraH9xW8FQ\ninD9FZRh8O+Snkx21/D4XWQz2MYWye/6HREgENCMb+j2DrFeg8kZHQzaFFV7\n8vZuofaj5gMLI+Cz5YmpN01LpiDpatJDMTB9SZ4ZYKqfjlKK4vDbrzIF10Vo\nEcGvSZ16GadjtsMPEfisCKWBjzJcf849IZDF6zJ3rKf5aYjNGhPVYTbWW7ke\nWPQ+oztt+8FImzg/Nk9Fufc+QXCGhjEjUM6RRakEHXNXmkS+grbFdDB+1rg9\nZjUG\r\n=PmUY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./bin/migrate.js","engines":{"node":">=8"},"gitHead":"6ea1ec2f6500839f45e391cac6851190d0fa6ad7","_npmUser":{"name":"msvujnovic-becklyn","email":"mv@becklyn.com"},"repository":{"url":"git+ssh://git@github.com/Becklyn/contenful-migrations.git","type":"git"},"_npmVersion":"6.14.11","description":"A tool for executing content model migrations in Contentful","directories":{},"_nodeVersion":"14.16.0","dependencies":{"contentful-cli":"^1.8.15","contentful-migration":"^4.2.3","contentful-management":"^7.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/contentful-migrations_0.1.1_1627652337655_0.6829697624994227","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-07-30T13:24:35.191Z","modified":"2026-09-15T07:07:22.660Z","0.1.0":"2021-07-30T13:24:35.411Z","0.1.1":"2021-07-30T13:38:57.776Z"},"bugs":{"url":"https://github.com/Becklyn/contenful-migrations/issues"},"author":{"name":"Marko S. Vujnovic","email":"mv@becklyn.com"},"license":"MIT","homepage":"https://github.com/Becklyn/contenful-migrations","repository":{"url":"git+ssh://git@github.com/Becklyn/contenful-migrations.git","type":"git"},"description":"A tool for executing content model migrations in Contentful","maintainers":[{"email":"jesko.plitt@unic.com","name":"jesko-plitt"},{"email":"mv@becklyn.com","name":"msvujnovic-becklyn"},{"email":"ch@becklyn.com","name":"hautzi"},{"email":"david.smusz@unic.com","name":"dsmoosh-becklyn"},{"email":"msc@becklyn.com","name":"msc-at-becklyn"},{"email":"mg@becklyn.com","name":"mangoischke"},{"email":"jj@becklyn.com","name":"jj_becklyn"},{"email":"svenja.haas@unic.com","name":"svenja-haas"},{"email":"Jakob.Haag@gmx.de","name":"d4lister"},{"email":"info@glassp.dev","name":"glassp"}],"readme":"# Becklyn Contentful Migrations\n\nA tool for managing content model migrations for Contentful. Inspired by the \n[\"Integrating migrations in a continuous delivery pipeline with CircleCI\"](https://www.contentful.com/developers/docs/tutorials/general/continuous-integration-with-circleci/)\narticle and [Doctrine Migrations](https://github.com/doctrine/migrations), based on examples from  \n[contentful-labs/continous-delivery-environments-example](https://github.com/contentful-labs/continous-delivery-environments-example). \n\n## Introduction\n\nThe tool can run migrations on both production-type environments which need to be stable and supporting rollbacks, as\nwell as on temporary feature environments. To do the former, you need to have environment aliases enabled in your Contentful space.\n\nFor production-type environments, it creates a copy of the `master` environment, applies migrations, and switches the alias to\npoint at the freshly migrated environment. The original environment is still available in case a rollback is needed.\n\nFor temporary environments it checks if the environment already exists, deletes it if it does, creates it\nas a copy of master and applies migrations. This is intended for environments working with feature branches of applications.\n\nA third type of environment is supported as well: a permanent, non-aliased environment where there is no need for rollbacks.\nThese are treated similar to temporary environments, but the environment is not deleted and recreated from master if it\nalready exists before migrations are applied. This is intended for staging, QA or similar environments.\n\n## Writing migrations\n\nRead the official Contentful [tutorial](https://www.contentful.com/developers/docs/tutorials/cli/scripting-migrations/).\n\n## Contentful setup\n\nTo track which migrations have been applied to an environment, the tool requires a `migrationVersions` content model to be\nmanually created in the environment. It needs to have two fields: `version` (short text) and `executedAt` (date & time).\nThe name and field id of those fields need to be the same.\n\n## Installation\n\n### Globally\n\n```bash\nnpm install -g @becklyn/contentful-migrations\n```\n\n\n### Locally\n\n```bash\nnpm install --save-dev @becklyn/contentful-migrations\n```\n\n## Usage\n\n### Global installation \n\n```bash\nbecklyn-contentful-migrate <args>\n```\n\n### Local installation\n\n```bash\nnpx becklyn-contentful-migrate <args>\n```\n\n\n### Arguments\n\n```bash\nbecklyn-contentful-migrate <space_id> <environment> <cma_access_token> [migrations_dir] [config_file]\n```\n\n* `space_id`: The id of the Contentful space to run migrations on. If you open Contentful, your url will be something like `https://app.contentful.com/spaces/a1ht3vblaj8x/...`; in this case, `a1ht3vblaj8x` is your space id.\n* `environment`: The name of the environment on which to execute migrations on.\n* `cma_access_token`: You need to create a CMA access token in your space to execute migrations, and pass it to the command.\n* `migrations_dir`: Path to the folder where your migrations are stored. Defaults to `migrations`.\n* `config_file`: Path to the migrations configuration file. Defaults to `contentful_migrations.json`.\n\n## Configuration\n\nThe configuration file is a json file with the following structure:\n\n```json\n{\n  \"environments\": [\n    {\n      \"environment\": \"master\",\n      \"alias\": true,\n      \"persistent\": false\n    },\n    {\n      \"environment\": \"foo\",\n      \"alias\": false,\n      \"persistent\": false\n    },\n    ...\n  ]\n}\n```\n\nFor each environment, two configuration properties are available:\n\n* `alias`: Set to true if the environment is aliased, in other words if it should be treated as a production-type environment as described in the introduction. If set to true, `persistent` is ignored.\n* `persistent`: Only relevant if `alias` is set to `false`. If false, the environment will be deleted and recreated from master before migrations are executed. If true, it migrations will be applied to it without deletion/recreation.  \n\nThe default configuration for environments named `master`, `staging` and `integration` have `alias` set to true, while for all other environments both `alias` and `persistent` are set to false. Use the configuration file to override this behavior.\n\n## Examples\nThe `examples` folder contains examples of migrations, initial content they can be applied to, and a configuration file.","readmeFilename":"README.MD"}