Skip to content

Commit

Permalink
create postgres extension (#18)
Browse files Browse the repository at this point in the history
this extension is required for `datasets` because of UUID.
  • Loading branch information
honnix authored and chanadian committed Nov 19, 2019
1 parent c1c8fde commit e952e02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datacatalog/pkg/repositories/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit e952e02

Please sign in to comment.