You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
660 B
JavaScript

'use strict';
const Promise = require("bluebird");
module.exports = function attemptForeignKeyConstraintViolation(knex) {
return Promise.try(() => {
return knex("foreign_key_constraint_users").insert([{
name: "Joe",
username: "joe"
}, {
name: "Jane",
username: "jane"
}]).returning("id");
}).then((ids) => {
return knex("foreign_key_constraint_posts").insert([{
user_id: ids[0],
body: "Foo"
}, {
user_id: ids[1],
body: "Bar"
}, {
user_id: 567213,
body: "Baz"
}])
});
};