0
I am creating a Node API for a personal project with Postgresql connection. Is there any way to migrate (so that records are automatically created in the database) from created models? I know how this can be done using Mongoose (Connection to Mongodb) with:
const mongoose = require('mongoose');
const Product = mongoose.model('Product');
module.exports = {
async store(req, res) {
const products = await Product.create(req.body);
return res.json(products);
},
}
But in this project the entities of my bank have relationships. Any ideas? Thanks for the help!
Sequelize should solve your problem, just map the tables to the models, then just create the Eds and migrates, for I am one of the best ORM, I use for a long time.
– Chance