Avoid error with MariaDB 10.0.30 (#43)

Primary keys cannot be set after creating foreign keys.
This commit is contained in:
José Proença 2017-07-18 21:35:40 +01:00 committed by Mihail Diordiev
parent 87b9a1c5c7
commit bda845add5

View File

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