Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Postgres function rand() does not exist #22

Open
devkdouglass opened this issue Nov 17, 2020 · 0 comments
Open

Postgres function rand() does not exist #22

devkdouglass opened this issue Nov 17, 2020 · 0 comments
Assignees

Comments

@devkdouglass
Copy link

devkdouglass commented Nov 17, 2020

If Craft is set up to use Postgres,$localAssets->orderBy('RAND()'); in Fields.php will throw exception 'SQLSTATE[42883]: Undefined function: 7 ERROR: function rand() does not exist

Replacing it with $localAssets->orderBy('random()'); seems to be the fix.

@janhenckens janhenckens self-assigned this Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants