knex/lib/seed/stub/ts.stub
Vicente Canales da54cf1ecf
Prefer void as return type on migration generator ts stub (#3865)
The liberal use of `any` is frowned upon by some default tslint
configurations. That combined with the fact the these functions don't
need to return anything, makes it reasonable to use `void` over `any`
for the return type.
2020-05-22 20:48:38 +02:00

14 lines
359 B
Plaintext

import * as Knex from "knex";
export async function seed(knex: Knex): Promise<void> {
// Deletes ALL existing entries
await knex("table_name").del();
// Inserts seed entries
await knex("table_name").insert([
{ id: 1, colName: "rowValue1" },
{ id: 2, colName: "rowValue2" },
{ id: 3, colName: "rowValue3" }
]);
};