WIP Added model, migration and bulk upsert fnc.

This commit is contained in:
Naida Vatric
2020-01-21 16:28:47 +01:00
parent 42eddb3aa5
commit 8d3f001678
5 changed files with 65 additions and 22 deletions

View File

@@ -0,0 +1,19 @@
"use strict";
module.exports = {
up: (queryInterface, Sequelize) => {
// ??
const realEstateInitialData = await queryInterface.Sequelize.findall ();
const priceHistoryInitialData = realEstateInitialData.map ();
return queryInterface.bulkInsert(
"PriceHistory",
priceHistoryInitialData,
{}
);
},
down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete("PriceHistory", null, {});
}
};