From bda845add5abdd6087b5bbfda501876de291555f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Proen=C3=A7a?= Date: Tue, 18 Jul 2017 21:35:40 +0100 Subject: [PATCH] Avoid error with MariaDB 10.0.30 (#43) Primary keys cannot be set after creating foreign keys. --- lib/db/migrations/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db/migrations/index.js b/lib/db/migrations/index.js index 2545997..7bdd00a 100644 --- a/lib/db/migrations/index.js +++ b/lib/db/migrations/index.js @@ -54,11 +54,11 @@ exports.up = function(knex, Promise) { table.boolean('readOnly').defaultTo(false); table.uuid('userId'); table.uuid('appId'); + table.primary(['userId', 'appId']); table.foreign('userId') .references('id').inTable('remotedev_users').onDelete('CASCADE').onUpdate('CASCADE'); table.foreign('appId') .references('id').inTable('remotedev_apps').onDelete('CASCADE').onUpdate('CASCADE'); - table.primary(['userId', 'appId']); }) ]) };