Skip to content

Commit

Permalink
Avoid error with MariaDB 10.0.30 (#43)
Browse files Browse the repository at this point in the history
Primary keys cannot be set after creating foreign keys.
  • Loading branch information
akaztp authored and zalmoxisus committed Jul 18, 2017
1 parent 87b9a1c commit bda845a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
})
])
};
Expand Down

0 comments on commit bda845a

Please sign in to comment.