Avoid error with MariaDB 10.0.30 (#43)
Primary keys cannot be set after creating foreign keys.
This commit is contained in:
parent
87b9a1c5c7
commit
bda845add5
@ -54,11 +54,11 @@ exports.up = function(knex, Promise) {
|
|||||||
table.boolean('readOnly').defaultTo(false);
|
table.boolean('readOnly').defaultTo(false);
|
||||||
table.uuid('userId');
|
table.uuid('userId');
|
||||||
table.uuid('appId');
|
table.uuid('appId');
|
||||||
|
table.primary(['userId', 'appId']);
|
||||||
table.foreign('userId')
|
table.foreign('userId')
|
||||||
.references('id').inTable('remotedev_users').onDelete('CASCADE').onUpdate('CASCADE');
|
.references('id').inTable('remotedev_users').onDelete('CASCADE').onUpdate('CASCADE');
|
||||||
table.foreign('appId')
|
table.foreign('appId')
|
||||||
.references('id').inTable('remotedev_apps').onDelete('CASCADE').onUpdate('CASCADE');
|
.references('id').inTable('remotedev_apps').onDelete('CASCADE').onUpdate('CASCADE');
|
||||||
table.primary(['userId', 'appId']);
|
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user