Files
artdanj-api/database/migrations/1628110400158_projects.ts
Arthur DANJOU ed17d86913 Working
Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
2021-08-05 13:41:57 +02:00

18 lines
434 B
TypeScript

import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Projects extends BaseSchema {
protected tableName = 'projects'
public async up () {
this.schema.table(this.tableName, (table) => {
table.integer('cover_id').unsigned().references('files.id').onDelete('CASCADE')
})
}
public async down () {
this.schema.table(this.tableName, (table) => {
table.dropColumn('cover_id')
})
}
}