Explorar el Código

add drop table to ensure existing installs get new schema

Anthony Woods hace 10 años
padre
commit
40d946a6e3
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      pkg/services/sqlstore/migrations/app_settings.go

+ 4 - 2
pkg/services/sqlstore/migrations/app_settings.go

@@ -4,7 +4,7 @@ import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
 
 func addAppSettingsMigration(mg *Migrator) {
 
-	appSettingsV1 := Table{
+	appSettingsV2 := Table{
 		Name: "app_settings",
 		Columns: []*Column{
 			{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
@@ -22,7 +22,9 @@ func addAppSettingsMigration(mg *Migrator) {
 		},
 	}
 
-	mg.AddMigration("create app_settings table v1", NewAddTableMigration(appSettingsV1))
+	mg.AddMigration("Drop old table app_settings v1", NewDropTableMigration("app_settings"))
+
+	mg.AddMigration("create app_settings table v2", NewAddTableMigration(appSettingsV2))
 
 	//-------  indexes ------------------
 	addTableIndicesMigrations(mg, "v3", appSettingsV1)