Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 500 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 500 Bytes

PM

migrate up --compiler="ts:./export-ts-node.js" --migrations-dir 'src/db/migrations'

migration file example:

import { Admin } from "../models/AdminModel"; import { Server } from "../../../server";

const server = new Server(); server.setDbConnection();

module.exports.up = async function (next: any) { await Admin.updateMany({}, { birthDate: "03/05/1999" }); next(); };

module.exports.down = async function (next: any) { await Admin.updateMany({}, { $unset: { birthDate: 1 } }); next(); };