Add PostColor and content

This commit is contained in:
2021-08-28 22:36:38 +02:00
parent 48552f0ccf
commit 8f81926447
12 changed files with 156 additions and 1 deletions

View File

@@ -30,6 +30,11 @@ export default class Posts extends BaseSchema {
.unsigned()
.references('translations.id')
.onDelete('CASCADE')
table
.integer('post_color_id')
.unsigned()
.references('post_colors.id')
.onDelete('CASCADE')
table.timestamps(true, true)
})
}

View File

@@ -5,7 +5,7 @@ export default class Maintenances extends BaseSchema {
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.increments('id').primary()
table.boolean('active').defaultTo(false).notNullable()
table
.integer('reason_id')

View File

@@ -0,0 +1,18 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class PostColors extends BaseSchema {
protected tableName = 'post_colors'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name').notNullable()
table.string('color').notNullable()
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}