Preload label

This commit is contained in:
2021-08-23 13:40:52 +02:00
parent d59a26f514
commit 6abe3e5601
2 changed files with 4 additions and 2 deletions

View File

@@ -13,7 +13,9 @@ export default class ProjectsController {
.orderBy('id', 'asc')
.preload('cover')
.preload('description')
.preload('tags')
.preload('tags', (tags) => {
tags.preload('label')
})
})
}

View File

@@ -14,7 +14,7 @@ export default class Projects extends BaseSchema {
.onDelete('CASCADE')
table.string('url').notNullable()
table
.integer('file_id')
.integer('cover_id')
.unsigned()
.references('files.id')
.onDelete('CASCADE')