Last active
January 31, 2020 15:32
-
-
Save broofa/2d85e249d219406e54ab14b3c8f4f36c to your computer and use it in GitHub Desktop.
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 characters
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, | |
validate: { | |
customValidator() { | |
throw Error('Why is this being run???'); | |
} | |
} | |
} | |
}, {timestamps: false}); | |
// This throws. It shouldn't. | |
await Thing.create(); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment