From 5eb4afe0a261e5aeca56b24191bc8a84570e7ff8 Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 21 Oct 2019 12:59:15 +0200 Subject: uuids --- src/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/db.go') diff --git a/src/db.go b/src/db.go index 98a9305..fb71b80 100644 --- a/src/db.go +++ b/src/db.go @@ -148,7 +148,9 @@ func dbDeleteChallengeByUUID(uuid string) error { func dbCreateTableIfNotExist(db *sql.DB) error { log.Println("Creating a table in case it doesn't exist") - query := `CREATE TABLE public.challenges + query := `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + +CREATE TABLE public.challenges ( uuid uuid NOT NULL DEFAULT uuid_generate_v4(), name character varying COLLATE pg_catalog."default" NOT NULL, -- cgit 1.4.1