1
Fork 0

Fix timeline order with sqlite3. It should be ordered as MySQL and PGSQL like (year, month, day). (#954)

This commit is contained in:
Googol Lee 2024-05-31 10:35:41 +02:00 committed by GitHub
parent 6693920b61
commit ddacba85db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ func MyTimeline(db *gorm.DB, user *models.User, paginate *models.Pagination, onl
Order("media.date_shot DESC")
case drivers.SQLITE:
query = query.
Order("strftime('%j', media.date_shot) DESC"). // convert to day of year 001-366
Order("strftime('%Y-%m-%d', media.date_shot) DESC"). // convert to YYYY-MM-DD
Order("albums.title ASC").
Order("TIME(media.date_shot) DESC")
default: