From eaef191c1ebece52a0fa60a5c61e514fc69c8bc4 Mon Sep 17 00:00:00 2001 From: monoid Date: Sun, 3 Jan 2021 01:38:37 +0900 Subject: [PATCH] add seed --- seeds/initseed.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 seeds/initseed.ts diff --git a/seeds/initseed.ts b/seeds/initseed.ts new file mode 100644 index 0000000..b91ed7c --- /dev/null +++ b/seeds/initseed.ts @@ -0,0 +1,20 @@ +import Knex from "knex"; + +exports.seed = async function(knex:Knex) { + // Deletes ALL existing entries + await knex('contents').del(); + await knex('contents').insert({ + title:"aaa", + basepath:"testdata", + content_type:"manga", + filename:"test_zip.zip", + additional:JSON.stringify({comment:"comment"}) + }); + await knex('contents').insert({ + title:"aaa", + basepath:"testdata", + content_type:"video", + filename:"video_test.mp4", + additional:JSON.stringify({comment:"test comment"}) + }); +};