Create database should take the name of the database

This commit is contained in:
Jake Sanders 2019-12-16 14:15:30 +00:00
parent 59246e0412
commit e8e112144f

View File

@ -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