about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-21 12:59:15 +0200
committerEmile <hanemile@protonmail.com>2019-10-21 12:59:15 +0200
commit5eb4afe0a261e5aeca56b24191bc8a84570e7ff8 (patch)
tree0f6e83ec5b56461d8c04eb512e009afc05ca0884 /src
parent12ee88e433afda3baad4395879994a9eb07c82b9 (diff)
uuids
Diffstat (limited to 'src')
-rw-r--r--src/db.go4
1 files changed, 3 insertions, 1 deletions
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,