Stars: Add dashboard_uid and org_id to table (#96408)

This commit is contained in:
Stephanie Hingtgen
2024-11-15 09:51:31 -06:00
committed by GitHub
parent c6a90ed3cd
commit b12c731d59
14 changed files with 340 additions and 79 deletions
+1 -17
View File
@@ -35,6 +35,7 @@ func (oss *OSSMigrations) AddMigration(mg *Migrator) {
addStarMigrations(mg)
addOrgMigrations(mg)
addDashboardMigration(mg) // Do NOT add more migrations to this function.
addDashboardUIDStarMigrations(mg)
addDataSourceMigration(mg)
addApiKeyMigrations(mg)
addDashboardSnapshotMigrations(mg)
@@ -141,20 +142,3 @@ func (oss *OSSMigrations) AddMigration(mg *Migrator) {
accesscontrol.AddReceiverCreateScopeMigration(mg)
}
func addStarMigrations(mg *Migrator) {
starV1 := Table{
Name: "star",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "user_id", Type: DB_BigInt, Nullable: false},
{Name: "dashboard_id", Type: DB_BigInt, Nullable: false},
},
Indices: []*Index{
{Cols: []string{"user_id", "dashboard_id"}, Type: UniqueIndex},
},
}
mg.AddMigration("create star table", NewAddTableMigration(starV1))
mg.AddMigration("add unique index star.user_id_dashboard_id", NewAddIndexMigration(starV1, starV1.Indices[0]))
}