Rework migrations schemes

This commit is contained in:
2021-08-16 22:32:08 +02:00
parent e22e0b55c5
commit 09e5b2f76f
11 changed files with 32 additions and 37 deletions

View File

@@ -6,10 +6,15 @@ export default class Projects extends BaseSchema {
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name')
table.string('description')
table.string('url')
table.integer('progress')
table.string('name').notNullable()
table.string('description').notNullable()
table.string('url').notNullable()
table.integer('progress').notNullable()
table
.integer('file_id')
.unsigned()
.references('files.id')
.onDelete('CASCADE')
table.timestamps(true, true)
})
}