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 '';
|
return '';
|
||||||
}
|
}
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var usedConnector = this.dataSource.connector.name;
|
||||||
if (order === 'rand') {
|
if (order === 'rand') {
|
||||||
|
if (usedConnector === 'mysql') {
|
||||||
return 'ORDER BY RAND()';
|
return 'ORDER BY RAND()';
|
||||||
|
} else if (usedConnector === 'postgres' || usedConnector === 'oracle') {
|
||||||
|
return 'ORDER BY RANDOM()';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (typeof order === 'string') {
|
if (typeof order === 'string') {
|
||||||
order = [order];
|
order = [order];
|
||||||
|
|
Loading…
Reference in New Issue