/
home
/
infinitibizsol
/
.trash
/
routes.3
/
File Upload :
llllll
Current File: /home/infinitibizsol/.trash/routes.3/migrationsRoute.js
const router = require("express").Router(); const { createNewMigration, runMigrations, undoLastMigration, undoAllMigrations, } = require("../run-migrations"); router.post("/create-migration", async (req, res) => { try { createNewMigration(req.body.migrationName); return res.send("New Migration Is Creating!"); } catch (error) { return res.json({ errorMessage: error.message }); } }); router.get("/run-migrations", async (req, res) => { try { runMigrations(); return res.send("Migrations Are Running!"); } catch (error) { return res.json({ errorMessage: error.message }); } }); router.get("/undo-last-migration", async (req, res) => { try { undoLastMigration(); return res.send("Undo Migrations Are Running"); } catch (error) { return res.json({ errorMessage: error.message }); } }); router.get("/undo-all-migration", async (req, res) => { try { undoAllMigrations(); return res.send("Undo All Migrations Are Running"); } catch (error) { return res.json({ errorMessage: error.message }); } }); module.exports = router;
Copyright ©2k19 -
Hexid
|
Tex7ure