Files
outline/server/migrations/20240930113921-hash-api-keys.js
T
2024-10-01 21:40:09 -04:00

30 lines
563 B
JavaScript

"use strict";
const { execSync } = require("child_process");
const path = require("path");
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up() {
if (
process.env.NODE_ENV === "test" ||
process.env.DEPLOYMENT === "hosted"
) {
return;
}
const scriptName = path.basename(__filename);
const scriptPath = path.join(
process.cwd(),
"build",
`server/scripts/${scriptName}`
);
execSync(`node ${scriptPath}`, { stdio: "inherit" });
},
async down() {
// noop
},
};