36 lines
749 B
JavaScript
36 lines
749 B
JavaScript
const Marca = require('../../server/models/tablas/Marca');
|
|
|
|
async function fillMarca() {
|
|
let count = 1;
|
|
let limit = 11;
|
|
let marcas = [
|
|
"HP",
|
|
"ECOIN",
|
|
"SONY",
|
|
"LENOVO",
|
|
"DELL",
|
|
"ACER",
|
|
"ASUS",
|
|
"APPLE",
|
|
"COMPAQ",
|
|
"GATEWAY",
|
|
"IBM"
|
|
];
|
|
|
|
console.log('\n\tFilling out «marca».'.cyan.italic.bold);
|
|
|
|
for (marca of marcas) {
|
|
await Marca.create({
|
|
marca
|
|
})
|
|
.then(() => {
|
|
console.log(`${ count }/${ limit }\trecords created.`);
|
|
count++;
|
|
})
|
|
.catch(() => {
|
|
throw new Error();
|
|
});
|
|
};
|
|
};
|
|
|
|
module.exports = fillMarca; |