fix(postgres): fixed issue with postgres caused by wrong prefrences table types, dropped table and created it with correct column types, fixes #4558

This commit is contained in:
Torkel Ödegaard 2016-04-05 11:24:08 -04:00
parent 676e950fa3
commit 9b30634217
4 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,9 @@
# 3.0.0-beta2 (unreleased)
# 3.0.0-beta3 (unreleased)
### Bug fixes
* **Postgres**: Fixed page render crash when using postgres, fixes [#4558](https://github.com/grafana/grafana/issues/4558)
# 3.0.0-beta2 (2016-04-04)
### New Features (introduces since 3.0-beta1)
* **Preferences**: Set home dashboard on user and org level, closes [#1678](https://github.com/grafana/grafana/issues/1678)

View File

@ -16,7 +16,7 @@ rpm_ver=3.0.0-beta21459801392
#wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
¤package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
#package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
# package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm
# package_cloud push grafana/stable/el/6 grafana-${version}-1.x86_64.rpm

View File

@ -116,6 +116,7 @@ func (this *service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if avatar.Expired() {
if err := avatar.Update(); err != nil {
log.Trace("avatar update error: %v", err)
avatar = this.notFound
}
}

View File

@ -10,12 +10,12 @@ func addPreferencesMigrations(mg *Migrator) {
Name: "preferences",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_Int, Nullable: true},
{Name: "user_id", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "user_id", Type: DB_BigInt, Nullable: false},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "home_dashboard_id", Type: DB_BigInt, Nullable: true},
{Name: "timezone", Type: DB_NVarchar, Length: 50, Nullable: true},
{Name: "theme", Type: DB_NVarchar, Length: 20, Nullable: true},
{Name: "home_dashboard_id", Type: DB_BigInt, Nullable: false},
{Name: "timezone", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "theme", Type: DB_NVarchar, Length: 20, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
@ -25,6 +25,8 @@ func addPreferencesMigrations(mg *Migrator) {
},
}
mg.AddMigration("drop preferences table v3", NewDropTableMigration("preferences"))
// create table
mg.AddMigration("create preferences table v2", NewAddTableMigration(preferencesV2))
mg.AddMigration("create preferences table v3", NewAddTableMigration(preferencesV2))
}