From 65025b4c39b287437b87b51a2c4cdd6c0bf09817 Mon Sep 17 00:00:00 2001 From: Honnix Date: Tue, 19 Nov 2019 18:07:41 +0100 Subject: [PATCH] create postgres extension (#18) this extension is required for `datasets` because of UUID. --- pkg/repositories/handle.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/repositories/handle.go b/pkg/repositories/handle.go index 15db4de55f..b66bd92b22 100644 --- a/pkg/repositories/handle.go +++ b/pkg/repositories/handle.go @@ -66,6 +66,10 @@ func (h *DBHandle) CreateDB(dbName string) error { } func (h *DBHandle) Migrate() { + if h.db.Dialect().GetName() == config.Postgres { + logger.Infof(context.TODO(), "Creating postgres extension uuid-ossp if it does not exist") + h.db.Exec("CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"") + } h.db.AutoMigrate(&models.Dataset{}) h.db.AutoMigrate(&models.Artifact{}) h.db.AutoMigrate(&models.ArtifactData{})