Chore: Rename Id to ID in alerting models (#62777)
* Chore: Rename Id to ID in alerting models * Add xorm tags for datasource * Add xorm tag for uid
This commit is contained in:
@@ -55,14 +55,14 @@ func (e externalAlertmanagerToDatasources) Exec(sess *xorm.Session, mg *migrator
|
||||
return err
|
||||
}
|
||||
ds := &datasources.DataSource{
|
||||
OrgId: result.OrgID,
|
||||
OrgID: result.OrgID,
|
||||
Name: fmt.Sprintf("alertmanager-%s", uid),
|
||||
Type: "alertmanager",
|
||||
Access: "proxy",
|
||||
Url: uri,
|
||||
URL: uri,
|
||||
Created: time.Unix(result.CreatedAt, 0),
|
||||
Updated: time.Unix(result.UpdatedAt, 0),
|
||||
Uid: uid,
|
||||
UID: uid,
|
||||
Version: 1,
|
||||
JsonData: simplejson.NewFromAny(map[string]interface{}{
|
||||
"handleGrafanaManagedAlerts": true,
|
||||
|
||||
@@ -656,9 +656,9 @@ func createAlert(t *testing.T, orgId int64, dashboardId int64, panelsId int64, n
|
||||
}
|
||||
|
||||
return &models.Alert{
|
||||
OrgId: orgId,
|
||||
DashboardId: dashboardId,
|
||||
PanelId: panelsId,
|
||||
OrgID: orgId,
|
||||
DashboardID: dashboardId,
|
||||
PanelID: panelsId,
|
||||
Name: name,
|
||||
Message: "message",
|
||||
Frequency: int64(60),
|
||||
@@ -688,9 +688,9 @@ func createDashboard(t *testing.T, id int64, orgId int64, uid string) *dashboard
|
||||
func createDatasource(t *testing.T, id int64, orgId int64, uid string) *datasources.DataSource {
|
||||
t.Helper()
|
||||
return &datasources.DataSource{
|
||||
Id: id,
|
||||
OrgId: orgId,
|
||||
Uid: uid,
|
||||
ID: id,
|
||||
OrgID: orgId,
|
||||
UID: uid,
|
||||
Created: now,
|
||||
Updated: now,
|
||||
Name: uid, // Not tested, needed to satisfy contraint.
|
||||
|
||||
Reference in New Issue
Block a user