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

Function getAndInitializeTaskModel

test/integration/transaction.test.js:427–439  ·  test/integration/transaction.test.js::getAndInitializeTaskModel

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

defineMethod · 0.80
syncMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected