public dashboards: add public dashboard table (#48470)

* add public dashboard table migration
This commit is contained in:
Jeff Levin 2022-05-03 15:08:40 -08:00 committed by GitHub
parent 0b5ffcfcf0
commit b88644cb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package migrations
import (
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func addPublicDashboardMigration(mg *Migrator) {
var dashboardPublicCfgV1 = Table{
Name: "dashboard_public_config",
Columns: []*Column{
{Name: "uid", Type: DB_BigInt, IsPrimaryKey: true},
{Name: "dashboard_uid", Type: DB_NVarchar, Length: 40, Nullable: false},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "refresh_rate", Type: DB_Int, Nullable: false, Default: "30"},
{Name: "template_variables", Type: DB_MediumText, Nullable: true},
{Name: "time_variables", Type: DB_Text, Nullable: false},
},
Indices: []*Index{
{Cols: []string{"uid"}, Type: UniqueIndex},
{Cols: []string{"org_id", "dashboard_uid"}},
},
}
mg.AddMigration("create dashboard public config v1", NewAddTableMigration(dashboardPublicCfgV1))
addTableIndicesMigrations(mg, "v1", dashboardPublicCfgV1)
}

View File

@ -89,6 +89,8 @@ func (*OSSMigrations) AddMigration(mg *Migrator) {
}
addEntityEventsTableMigration(mg)
addPublicDashboardMigration(mg)
}
func addMigrationLogMigrations(mg *Migrator) {