Added Tags

This commit is contained in:
2021-08-16 22:38:58 +02:00
parent 98f9402de4
commit 2c4a7c0dda
5 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Tags extends BaseSchema {
protected tableName = 'tags'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table
.integer('label_id')
.unsigned()
.references('translations.id')
.onDelete('CASCADE')
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}