Last active
January 31, 2020 15:32
-
-
Save broofa/2d85e249d219406e54ab14b3c8f4f36c to your computer and use it in GitHub Desktop.
Revisions
-
broofa revised this gist
Jan 31, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,16 +12,16 @@ async function main() { aColumn: { type: Sequelize.STRING, allowNull: true, validate: { customValidator() { throw Error('Why is this being run???'); } } } }, {timestamps: false}); // This throws. It shouldn't. await Thing.create(); } main(); -
broofa renamed this gist
Jan 31, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
broofa created this gist
Jan 31, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ const Sequelize = require('sequelize'); async function main() { const sequelize = new Sequelize(null, null, null, { dialect: 'sqlite', storage: ':memory:', }); await sequelize.query('CREATE TABLE things (id INTEGER PRIMARY KEY, aColumn TEXT DEFAULT NULL)'); const Thing = await sequelize.define('thing', { aColumn: { type: Sequelize.STRING, allowNull: true, defaultValue: null, validate: { customValidator() { throw Error('This should not run!'); } } } }, {timestamps: false}); const thing = Thing.create(); } main();