Tried postgres
This commit is contained in:
@@ -50,7 +50,7 @@ func LoadModelsConfig() {
|
||||
DbCfg.Name = setting.Cfg.MustValue("database", "name")
|
||||
DbCfg.User = setting.Cfg.MustValue("database", "user")
|
||||
if len(DbCfg.Pwd) == 0 {
|
||||
DbCfg.Pwd = setting.Cfg.MustValue("database", "passwd")
|
||||
DbCfg.Pwd = setting.Cfg.MustValue("database", "password")
|
||||
}
|
||||
DbCfg.SslMode = setting.Cfg.MustValue("database", "ssl_mode")
|
||||
DbCfg.Path = setting.Cfg.MustValue("database", "path", "data/grafana.db")
|
||||
|
||||
@@ -61,9 +61,9 @@ func GetAccountByLogin(emailOrLogin string) (*models.Account, error) {
|
||||
func GetCollaboratorsForAccount(accountId int64) ([]*models.CollaboratorInfo, error) {
|
||||
collaborators := make([]*models.CollaboratorInfo, 0)
|
||||
|
||||
sess := x.Table("Collaborator")
|
||||
sess.Join("INNER", "Account", "Account.id=Collaborator.account_Id")
|
||||
sess.Where("Collaborator.for_account_id=?", accountId)
|
||||
sess := x.Table("collaborator")
|
||||
sess.Join("INNER", "account", "account.id=collaborator.account_Id")
|
||||
sess.Where("collaborator.for_account_id=?", accountId)
|
||||
err := sess.Find(&collaborators)
|
||||
|
||||
return collaborators, err
|
||||
@@ -91,9 +91,9 @@ func AddCollaborator(collaborator *models.Collaborator) error {
|
||||
|
||||
func GetOtherAccountsFor(accountId int64) ([]*models.OtherAccount, error) {
|
||||
collaborators := make([]*models.OtherAccount, 0)
|
||||
sess := x.Table("Collaborator")
|
||||
sess.Join("INNER", "Account", "Account.id=Collaborator.account_Id")
|
||||
sess.Where("Collaborator.account_id=?", accountId)
|
||||
sess := x.Table("collaborator")
|
||||
sess.Join("INNER", "account", "account.id=collaborator.account_Id")
|
||||
sess.Where("account_id=?", accountId)
|
||||
err := sess.Find(&collaborators)
|
||||
return collaborators, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user