Hello!
I may have been lying about the ‘fun’ part
Ultimately my problem has come down to this:
const applications = await Application.findAll({
order: ['createdAt', 'ASC'],
distinct: true,
attributes: [
'id',
'applicantId',
'jobId',
]
});
Adding the ‘ASC’ ordering property results in a query that seems to look for ‘ASC’ as an actual column: DatabaseError [SequelizeDatabaseError]: Unknown column 'application.ASC' in 'order clause'
.
Removing ‘ASC’/‘DESC’ orders the results correctly, but I need to be able to change between ascending and descending results, and I think I’m using the correct syntax: shown here
Has anyone got any ideas?
Thanks,
Nick