Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions server/database/uploadSeedData.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ var csClosedAuctions = new helpers.ColumnSet(['auction_id', 'winner', 'payment_s

module.exports = function insertDummyData(db) {
return db.tx((t) => {

var userInserts = t.none(helpers.insert(users, csUsers));
var artWorkInserts = t.none(helpers.insert(artworks, csArtWorks));
var auctionInserts = t.none(helpers.insert(auctions, csAuctions));
var bidInserts = t.none(helpers.insert(bids, csBids));
var profileInserts = t.none(helpers.insert(profiles, csProfiles));
var notificationInserts = t.none(helpers.insert(notifications, csNotifications));
var closedAuctionsInserts = t.none(helpers.insert(closedAuctions, csClosedAuctions));

var multiInsert = helpers.concat([
helpers.insert(users, csUsers),
helpers.insert(artworks, csArtWorks),
helpers.insert(auctions, csAuctions),
helpers.insert(bids, csBids),
helpers.insert(profiles, csProfiles),
helpers.insert(notifications, csNotifications),
helpers.insert(closedAuctions, csClosedAuctions)
]);

return t.batch([userInserts, artWorkInserts, auctionInserts, bidInserts, profileInserts, closedAuctionsInserts, notificationInserts]);
})
return t.none(multiInsert);
})
.then(() => {
console.log('success seeding data');
})
Expand Down