removed unused files
This commit is contained in:
parent
2ba7778901
commit
2bc25eb838
|
|
@ -1,9 +0,0 @@
|
|||
function pickRandom(args) {
|
||||
return args[Math.floor(Math.random() * args.length)];
|
||||
}
|
||||
|
||||
function randomDate() {
|
||||
return new Date(new Date() - 200000000000 * Math.random());
|
||||
}
|
||||
|
||||
module.exports = { pickRandom, randomDate };
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
const sequelize = require('../sequelize');
|
||||
const { pickRandom, randomDate } = require('./helpers/random');
|
||||
|
||||
async function reset() {
|
||||
console.log('Will rewrite the SQLite example database, adding some dummy data.');
|
||||
|
||||
await sequelize.sync({ force: true });
|
||||
|
||||
await sequelize.models.user.bulkCreate([
|
||||
{ firstName: 'Nolan', lastName: 'Ryan', dateOfBirth: new Date(1947, 1, 31), email: 'ryan.nolan@bullpen.com', password: 'nolan' },
|
||||
{ firstName: 'Sandy', lastName: 'Koufax', dateOfBirth: new Date(1935, 12, 30), email: 'sandy.koufax@bullpen.com', password: 'sandy' },
|
||||
{ firstName: 'Pedro', lastName: 'Martinez', dateOfBirth: new Date(1971, 10, 25), email: 'pedro.martinez@bullpen.com', password: 'pedro' },
|
||||
{ firstName: 'randy', lastName: 'johnson', dateOfBirth: new Date(1963, 9, 10), email: 'randy.johnson@bullpen.com', password: 'randy' },
|
||||
]);
|
||||
|
||||
await sequelize.models.pitchType.bulkCreate([
|
||||
{ name: 'Fastball', abbreviation: 'FB' },
|
||||
{ name: 'Curveball', abbreviation: 'CB' },
|
||||
{ name: 'Slider', abbreviation: 'SL' },
|
||||
{ name: 'Changeup', abbreviation: 'CH' },
|
||||
{ name: 'Cutter', abbreviation: 'CUT' },
|
||||
{ name: 'Sweeper', abbreviation: 'SW' },
|
||||
{ name: 'Slurve', abbreviation: 'SLV' },
|
||||
]);
|
||||
|
||||
// Let's create random instruments for each orchestra
|
||||
// for (const orchestra of await sequelize.models.orchestra.findAll()) {
|
||||
// for (let i = 0; i < 10; i++) {
|
||||
// const type = pickRandom([
|
||||
// 'violin',
|
||||
// 'trombone',
|
||||
// 'flute',
|
||||
// 'harp',
|
||||
// 'trumpet',
|
||||
// 'piano',
|
||||
// 'guitar',
|
||||
// 'pipe organ',
|
||||
// ]);
|
||||
//
|
||||
// await orchestra.createInstrument({
|
||||
// type: type,
|
||||
// purchaseDate: randomDate()
|
||||
// });
|
||||
//
|
||||
// // The following would be equivalent in this case:
|
||||
// // await sequelize.models.instrument.create({
|
||||
// // type: type,
|
||||
// // purchaseDate: randomDate(),
|
||||
// // orchestraId: orchestra.id
|
||||
// // });
|
||||
// }
|
||||
// }
|
||||
|
||||
console.log('Done!');
|
||||
}
|
||||
|
||||
reset();
|
||||
Loading…
Reference in New Issue