UNPKG

tspace-mysql

Version:

Tspace MySQL is a promise-based ORM for Node.js, designed with modern TypeScript and providing type safety for schema databases.

27 lines 968 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const table_1 = __importDefault(require("./table")); exports.default = (formCommand) => { const { file, type, cwd, dir, fs, npm } = formCommand; try { fs.accessSync(cwd + `/${file}`, fs.F_OK, { recursive: true }); } catch (e) { fs.mkdirSync(cwd + `/${file}`, { recursive: true }); } const folderMigrate = dir ? `${cwd}/${dir}/create_${file}_table${type}` : `${cwd}/create_${file}_table${type}`; const table = (0, table_1.default)({ table: file, npm, type }); fs.writeFile(folderMigrate, table, (err) => { if (err) console.log(err.message); }); console.log(`Migration : ${file} created successfully`); }; //# sourceMappingURL=make.js.map