mirror of
https://github.com/strapi/strapi.git
synced 2026-06-02 16:27:47 +00:00
Run migration_v5 on sqlite, postgres, mysql, and mariadb; add Compose mariadb service, db-mariadb tooling, and Strapi mysql2 wiring for --database mariadb. Extend filters `migrations` to tests/migration and examples/complex (compose, scripts, config, src, package.json) so harness changes trigger the job. Document CI vs CLI in tests/migration README; trim complex README; update v5 .env.example and add db/develop scripts.
27 lines
714 B
JavaScript
27 lines
714 B
JavaScript
'use strict';
|
|
|
|
function getNodeMajor() {
|
|
return Number(process.version.slice(1).split('.')[0]);
|
|
}
|
|
|
|
/**
|
|
* @param {number | undefined} requiredMajor
|
|
* @param {string} flagName e.g. initial-node
|
|
*/
|
|
function assertNodeMajor(requiredMajor, flagName) {
|
|
if (requiredMajor == null || !Number.isFinite(requiredMajor)) {
|
|
return;
|
|
}
|
|
const cur = getNodeMajor();
|
|
if (cur !== requiredMajor) {
|
|
console.error(
|
|
`\n❌ Node major mismatch: running ${process.version} (major ${cur}), ` +
|
|
`but --${flagName} requires major ${requiredMajor}. ` +
|
|
`Switch Node and re-run (e.g. nvm use ${requiredMajor}).\n`
|
|
);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
module.exports = { getNodeMajor, assertNodeMajor };
|