Я написал доменный классКак применить индекс в порядке убывания в классе домена grails?
class ReportCallByUser {
Integer userId;
String userName;
String reportName;
Date timeOfReportCall;
static constraints = {
}
static mapping = {
timeOfReportCall index: 'time_of_report_call_index'
}
Последняя строка создает индекс в базе данных, но и в порядке возрастания. Как я могу создать индекс на 'timeOfReportCall' по убыванию?
Спасибо заранее.
По крайней мере postgres позволяет иметь «ASC, DESC, NULLS FIRST и/или NULLS LAST» для индекса. см. https://www.postgresql.org/docs/current/static/sql-createindex.html – cfrick
это вполне может быть, но вы не можете сделать это внутри построителя GORM 'static mapping'. smth like 'timeOfReportCall index: 'time_of_report_call_index', order: 'desc'' – injecteer