From e8e112144f2a9eb0b87da6199ddda6838927e4d1 Mon Sep 17 00:00:00 2001 From: Jake Sanders Date: Mon, 16 Dec 2019 14:15:30 +0000 Subject: [PATCH] Create database should take the name of the database --- store/postgresql/postgresql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/postgresql/postgresql.go b/store/postgresql/postgresql.go index 3cce21a6..4162e1e1 100644 --- a/store/postgresql/postgresql.go +++ b/store/postgresql/postgresql.go @@ -176,13 +176,13 @@ func (s *sqlStore) initDB(options options.Options) error { } // Create "micro" schema - schema, err := s.db.Prepare("CREATE SCHEMA IF NOT EXISTS micro ;") + schema, err := s.db.Prepare(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s ;", s.database)) if err != nil { return err } _, err = schema.Exec() if err != nil { - return errors.Wrap(err, "Couldn't create Schema") + return errors.Wrap(err, "Couldn't create database") } // Create a table for the Store namespace