21 lines
456 B
JavaScript
21 lines
456 B
JavaScript
"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
|
|
};
|