Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document migrations setup #211

Open
jbmoelker opened this issue Nov 9, 2024 · 1 comment
Open

Document migrations setup #211

jbmoelker opened this issue Nov 9, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation v1 Head Start v1 private
Milestone

Comments

@jbmoelker
Copy link
Member

Should include:

  • using environments
  • creating / autogenerating migrations (could add a migrations:create script to help out)
  • use maintenance mode (could use script npx datocms maintenance:on|off, see datocms docs)
  • apply migrations (could use a migrations:apply script to help out)
  • promoting environments (could use a migrations:promote script to help out, see promote)
  • refer to this in docs/upgrading.md as performing a migration is required in case of new migration files.
@jbmoelker jbmoelker added documentation Improvements or additions to documentation v1 Head Start v1 private labels Nov 9, 2024
@jbmoelker jbmoelker added this to the v1 milestone Nov 9, 2024
@jbmoelker jbmoelker self-assigned this Nov 9, 2024
@jbmoelker jbmoelker mentioned this issue Nov 9, 2024
9 tasks
@jbmoelker
Copy link
Member Author

Verified this works npx jiti scripts/create-migration.ts where scripts/create-migration.ts:

import { exec } from 'node:child_process';
import { datocmsEnvironment } from '../datocms-environment';

exec(`npx datocms migrations:new --autogenerate=${datocmsEnvironment} ${datocmsEnvironment}`, (error, stdout, stderr) => {
  if (error) {
    console.error(`exec error: ${error}`);
    return;
  }
  console.log(`stdout: ${stdout}`);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation v1 Head Start v1 private
Projects
None yet
Development

No branches or pull requests

1 participant