CREATE TABLE public."Table" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
--id serial PRIMARY KEY,
"description" text,
"is_published" boolean );Primary key snippets
Handy snippets to help you set up Postgres to work with Whalesync
-- Delete the old primary key.
ALTER TABLE public."Table"
DROP COLUMN "id";
-- Add a new generated primary key.
ALTER TABLE public."Table"
ADD COLUMN "uuid" uuid PRIMARY KEY DEFAULT gen_random_uuid();ALTER TABLE public."Table"
ADD CONSTRAINT table_pk PRIMARY KEY ("uuid");uuid_genetate_v4()gen_random_uuid()nextval('column_name')Last updated
Was this helpful?

