SetVersions Fix

This commit is contained in:
alin104n
2017-04-09 20:40:03 +03:00
parent 06ec114ad6
commit fc8d55d27a
2 changed files with 6 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ import (
)
type MySQLStorage struct {
*SQLStorage
SQLStorage
}
func NewMySQLStorage(host, port, name, user, password string, maxConn, maxIdleConn int) (*SQLStorage, error) {
@@ -43,6 +43,8 @@ func NewMySQLStorage(host, port, name, user, password string, maxConn, maxIdleCo
db.DB().SetMaxOpenConns(maxConn)
//db.LogMode(true)
mySQLStorage := new(MySQLStorage)
mySQLStorage.db = db
mySQLStorage.Db = db.DB()
return &SQLStorage{db.DB(), db, mySQLStorage, mySQLStorage}, nil
}

View File

@@ -40,11 +40,13 @@ func NewPostgresStorage(host, port, name, user, password string, maxConn, maxIdl
db.DB().SetMaxOpenConns(maxConn)
//db.LogMode(true)
postgressStorage := new(PostgresStorage)
postgressStorage.db = db
postgressStorage.Db = db.DB()
return &SQLStorage{db.DB(), db, postgressStorage, postgressStorage}, nil
}
type PostgresStorage struct {
*SQLStorage
SQLStorage
}
func (self *PostgresStorage) SetVersions(vrs Versions, overwrite bool) (err error) {