MCPcopy
hub / github.com/sequelize/sequelize / getAndInitializeTaskModel

Function getAndInitializeTaskModel

test/integration/transaction.test.js:431–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429 describe.skip('deadlock handling', () => {
430 // Create the `Task` table and ensure it's initialized with 2 rows
431 const getAndInitializeTaskModel = async sequelize => {
432 const Task = sequelize.define('task', {
433 id: {
434 type: Sequelize.INTEGER,
435 primaryKey: true
436 }
437 });
438
439 await sequelize.sync({ force: true });
440 await Task.create({ id: 0 });
441 await Task.create({ id: 1 });
442 return Task;
443 };
444
445 // Lock the row with id of `from`, and then try to update the row
446 // with id of `to`

Callers 1

Calls 3

defineMethod · 0.80
syncMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected