Add condition for postgres and oracle
This commit is contained in:
parent
8355d803d4
commit
2b443c7723
|
@ -1185,8 +1185,13 @@ SQLConnector.prototype.buildOrderBy = function(model, order) {
|
|||
return '';
|
||||
}
|
||||
var self = this;
|
||||
var usedConnector = this.dataSource.connector.name;
|
||||
if (order === 'rand') {
|
||||
return 'ORDER BY RAND()';
|
||||
if (usedConnector === 'mysql') {
|
||||
return 'ORDER BY RAND()';
|
||||
} else if (usedConnector === 'postgres' || usedConnector === 'oracle') {
|
||||
return 'ORDER BY RANDOM()';
|
||||
}
|
||||
} else {
|
||||
if (typeof order === 'string') {
|
||||
order = [order];
|
||||
|
|
Loading…
Reference in New Issue