fix contents
This commit is contained in:
parent
9abf57bdf0
commit
74a4d01fcc
@ -1,20 +0,0 @@
|
|||||||
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"})
|
|
||||||
});
|
|
||||||
};
|
|
@ -34,6 +34,7 @@ class KnexContentsAccessor implements ContentAccessor{
|
|||||||
};
|
};
|
||||||
async del(id:number) {
|
async del(id:number) {
|
||||||
if (await this.findById(id) !== undefined){
|
if (await this.findById(id) !== undefined){
|
||||||
|
await this.knex.delete().from("content_tag_relation").where({content_id:id});
|
||||||
await this.knex.delete().from("contents").where({id:id});
|
await this.knex.delete().from("contents").where({id:id});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user