webstudio-is / webstudio

The web builder for advanced sites. An open-source visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
https://webstudio.is
GNU Affero General Public License v3.0
4.55k stars 495 forks source link

function get_random_uuid() does not exist #2971

Closed laith43d closed 6 months ago

laith43d commented 6 months ago

Hi, during my testing I got an error from Prisma during the initial migration, function get_random_uuid() does not exit.

You need to load the pgcrypto extension in the current database/schema with

CREATE EXTENSION pgcrypto;

like this (tested with PostgreSQL 13):

# SELECT gen_random_uuid();
ERROR:  function gen_random_uuid() does not exist
LINE 1: select gen_random_uuid();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
# CREATE EXTENSION pgcrypto;
CREATE EXTENSION
# SELECT gen_random_uuid();
           gen_random_uuid            
--------------------------------------
 19a12b49-a57a-4f1e-8e66-152be08e6165
(1 row)
kof commented 6 months ago

We haven't seen this yet, I am guessing newer Postgress versions have this extension built-in by default.

kof commented 6 months ago

@istarkov do we need to set a minimum postgress version as a requirement?