Merge branch 'price-history-log' into 'master'

Price history log

See merge request saburly/marketalarm/web!87
This commit was merged in pull request #87.
This commit is contained in:
Naida Vatric
2020-01-31 21:53:18 +00:00
7 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
"use strict";
const db = require("../../models/index");
const sequelize = require("sequelize");
const bulkUpsertPriceHistory = async priceHistoryData => {
try {
const order = [["realEstateId", "desc"]];
return await db.PriceHistory.bulkCreate(priceHistoryData, {
order,
ignoreDuplicates: true
});
} catch (e) {
console.log("Error bulk upserting priceHistory : ", e);
}
};
module.exports = {
bulkUpsertPriceHistory
};