mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
27 lines
626 B
TypeScript
27 lines
626 B
TypeScript
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
|
export default class Posts extends BaseSchema {
|
|
protected tableName = 'posts'
|
|
|
|
public async up () {
|
|
this.schema.table(this.tableName, (table) => {
|
|
table
|
|
.integer('content_id')
|
|
.unsigned()
|
|
.references('translations.id')
|
|
.onDelete('CASCADE')
|
|
table
|
|
.integer('post_color_id')
|
|
.unsigned()
|
|
.references('post_colors.id')
|
|
.onDelete('CASCADE')
|
|
})
|
|
}
|
|
|
|
public async down () {
|
|
this.schema.table(this.tableName, (table) => {
|
|
table.dropColumns('content_id', 'post_color_id')
|
|
})
|
|
}
|
|
}
|