mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Correlations: Add organization id (#72258)
* Add org_id to correlations * Add tests * Allow org_id to be null in case org_id=0 is used * Create organization to ensure stable id is generated * Fix linting * Ensure backwards compatibility * Add deprecation information * Migrate correlations indices * Default org_id when migrating * Remove redundant default * Make PK non-nullable
This commit is contained in:
@@ -109,6 +109,9 @@ type Correlation struct {
|
||||
// UID of the data source the correlation originates from
|
||||
// example: d0oxYRg4z
|
||||
SourceUID string `json:"sourceUID" xorm:"pk 'source_uid'"`
|
||||
// OrgID of the data source the correlation originates from
|
||||
// Example: 1
|
||||
OrgID int64 `json:"orgId" xorm:"pk 'org_id'"`
|
||||
// UID of the data source the correlation points to
|
||||
// example: PE1C5CBDA0504A6A3
|
||||
TargetUID *string `json:"targetUID" xorm:"target_uid"`
|
||||
@@ -286,8 +289,10 @@ type GetCorrelationsQuery struct {
|
||||
|
||||
type DeleteCorrelationsBySourceUIDCommand struct {
|
||||
SourceUID string
|
||||
OrgId int64
|
||||
}
|
||||
|
||||
type DeleteCorrelationsByTargetUIDCommand struct {
|
||||
TargetUID string
|
||||
OrgId int64
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user