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']); }) ]) };