protected override void Generate(AddNotNullConstraint op) { FormattedSql sql = string.Format(@"UPDATE {0} SET {1} = {2} WHERE {1} IS NULL", this.Quote(op.TableName), this.Quote(op.ColumnName), "{0}"); sql.Parameters.Add(DbTypeHelper.GetDefaultValue(op.DataType)); this.AddRun(new FormattedSqlMigrationRun { Sql = sql }); this.AddNotNullConstraint(op); }
protected virtual string GetDefaultValue(DbType dataType) { return DbTypeHelper.GetDefaultValue(dataType); }