WIP Added model, migration and bulk upsert fnc.
This commit is contained in:
19
app/seeders/20200121150443-initial-price-history.js
Normal file
19
app/seeders/20200121150443-initial-price-history.js
Normal 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, {});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user