This file contains 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