mirror of
https://github.com/knex/knex.git
synced 2025-07-23 08:52:25 +00:00
17 lines
410 B
Plaintext
17 lines
410 B
Plaintext
/**
|
|
* @param { import("knex").Knex } knex
|
|
* @returns { Promise<void> }
|
|
*/
|
|
exports.seed = function(knex) {
|
|
// Deletes ALL existing entries
|
|
return knex('table_name').del()
|
|
.then(function () {
|
|
// Inserts seed entries
|
|
return knex('table_name').insert([
|
|
{id: 1, colName: 'rowValue1'},
|
|
{id: 2, colName: 'rowValue2'},
|
|
{id: 3, colName: 'rowValue3'}
|
|
]);
|
|
});
|
|
};
|