|
@@ -4,7 +4,7 @@ import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
|
|
|
|
|
|
|
func addAppSettingsMigration(mg *Migrator) {
|
|
func addAppSettingsMigration(mg *Migrator) {
|
|
|
|
|
|
|
|
- appSettingsV1 := Table{
|
|
|
|
|
|
|
+ appSettingsV2 := Table{
|
|
|
Name: "app_settings",
|
|
Name: "app_settings",
|
|
|
Columns: []*Column{
|
|
Columns: []*Column{
|
|
|
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
|
|
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
|
|
@@ -13,6 +13,7 @@ func addAppSettingsMigration(mg *Migrator) {
|
|
|
{Name: "enabled", Type: DB_Bool, Nullable: false},
|
|
{Name: "enabled", Type: DB_Bool, Nullable: false},
|
|
|
{Name: "pinned", Type: DB_Bool, Nullable: false},
|
|
{Name: "pinned", Type: DB_Bool, Nullable: false},
|
|
|
{Name: "json_data", Type: DB_Text, Nullable: true},
|
|
{Name: "json_data", Type: DB_Text, Nullable: true},
|
|
|
|
|
+ {Name: "secure_json_data", Type: DB_Text, Nullable: true},
|
|
|
{Name: "created", Type: DB_DateTime, Nullable: false},
|
|
{Name: "created", Type: DB_DateTime, Nullable: false},
|
|
|
{Name: "updated", Type: DB_DateTime, Nullable: false},
|
|
{Name: "updated", Type: DB_DateTime, Nullable: false},
|
|
|
},
|
|
},
|
|
@@ -21,8 +22,10 @@ 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 ------------------
|
|
//------- indexes ------------------
|
|
|
- addTableIndicesMigrations(mg, "v3", appSettingsV1)
|
|
|
|
|
|
|
+ addTableIndicesMigrations(mg, "v3", appSettingsV2)
|
|
|
}
|
|
}
|