0.1.1 • Published 2 years ago
graphcms-migration-helper v0.1.1
GraphCMS Migration Helper
GraphCMS Migration Helper makes it easy to generate and run GraphCMS migrations.
Install
% npm install -g graphcms-migration-helper
Usege
Generate Migration
% gmh generate <Migration Name>
% gmh generate <Migration Name> -o <Out Directory Path>
% gmh generate <Migration Name> --out <Out Directory Path>
The following migration template will be created.
const { newMigration } = require('@graphcms/management');
const migration = newMigration({
endpoint: process.env.GRAPHCMS_ENDPOINT,
authToken: process.env.GRAPHCMS_TOKEN,
name: 'YYYYMMDDHHmmssSSS-<Migration Name>',
});
// Write your migration
module.exports = {
migration,
};
Migration file will be created in directory named graphcms-migrations
as default.
Execute Migration
% gmh migrate <Migration File Path>
% gmh migrate <Migration File Path> --dry-run