Using NodeJS and Sequelize 2.0, I'm writing a migration to create a new table. In addition to the primary key, I want to mark a second column to be enforced as unique. I can't find anything about this in the documentation.
migration.createTable('data', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
key: {
// needs to be unique
type: DataTypes.UUID,
allowNull: false
}
})
.then(function () {
done();
});