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

Function getAndInitializeTaskModel

test/integration/transaction.test.js:427–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425 describe('deadlock handling', () => {
426 // Create the `Task` table and ensure it's initialized with 2 rows
427 const getAndInitializeTaskModel = async sequelize => {
428 const Task = sequelize.define('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 // Lock the row with id of `from`, and then try to update the row
442 // with id of `to`

Callers 1

Calls 3

defineMethod · 0.80
syncMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…