From 76bf3506b2a9e7a9ddece83d733db8e19bceb55e Mon Sep 17 00:00:00 2001 From: Harminder virk Date: Fri, 26 Jun 2020 13:43:20 +0530 Subject: [PATCH] fix: make foreign key unsigned --- templates/migrations/api_tokens.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/migrations/api_tokens.txt b/templates/migrations/api_tokens.txt index f9d43d1..6e140c3 100644 --- a/templates/migrations/api_tokens.txt +++ b/templates/migrations/api_tokens.txt @@ -6,7 +6,7 @@ export default class {{ tokensSchemaName }} extends BaseSchema { public async up () { this.schema.createTable(this.tableName, (table) => { table.increments('id').primary() - table.integer('user_id').references('id').inTable('users').onDelete('CASCADE') + table.integer('user_id').unsigned().references('id').inTable('users').onDelete('CASCADE') table.string('name').notNullable() table.string('type').notNullable() table.string('token', 64).notNullable()