1
我想与NOT_NULL
约束添加列,以便列将包含随机默认值下面是我的代码我怎样才能做到这一点添加列随机值Sequelize PostgreSQL的
up: function (queryInterface, Sequelize, done) {
queryInterface.addColumn(
{
tableName: 'someTable',
schema: 'sometemplate'
},
'someColumn', //column name
{ //column date type and constraint
type: Sequelize.STRING,
allowNull: false,
defaultValue: // I want this to random value
})
.then(function() { done() })
.catch(done);
}