File tree Expand file tree Collapse file tree 2 files changed +9
-26
lines changed Expand file tree Collapse file tree 2 files changed +9
-26
lines changed Original file line number Diff line number Diff line change @@ -116,9 +116,7 @@ func (p Dora) RootPkgPath() string {
116
116
}
117
117
118
118
func (p Dora ) MigrationScripts () []plugin.MigrationScript {
119
- return []plugin.MigrationScript {
120
- migrationscripts .DoraMigrationScript ,
121
- }
119
+ return migrationscripts .All ()
122
120
}
123
121
124
122
func (p Dora ) MakeMetricPluginPipelinePlanV200 (projectName string , options json.RawMessage ) (coreModels.PipelinePlan , errors.Error ) {
Original file line number Diff line number Diff line change @@ -18,30 +18,15 @@ limitations under the License.
18
18
package migrationscripts
19
19
20
20
import (
21
- "github.com/apache/incubator-devlake/core/context"
22
- "github.com/apache/incubator-devlake/core/errors"
23
- "github.com/apache/incubator-devlake/plugins/dora/models"
21
+ "github.com/apache/incubator-devlake/core/plugin"
24
22
)
25
23
26
- // Export the migration script for use in impl.go
27
- var DoraMigrationScript = & doraMigrationScript {}
28
-
29
- type doraMigrationScript struct {}
30
-
31
- func (script * doraMigrationScript ) Up (basicRes context.BasicRes ) errors.Error {
32
- // Just run the migration once - directly on the model
33
- db := basicRes .GetDal ()
34
- err := db .AutoMigrate (& models.IssueLeadTimeMetric {})
35
- if err != nil {
36
- return errors .Convert (err )
24
+ // All return all the migration scripts
25
+ func All () []plugin.MigrationScript {
26
+ return []plugin.MigrationScript {
27
+ new (addDoraBenchmark ),
28
+ new (fixDoraBenchmarkMetric ),
29
+ new (adddoraBenchmark2023 ),
30
+ new (addIssueLeadTimeMetricsTable ),
37
31
}
38
- return nil
39
- }
40
-
41
- func (* doraMigrationScript ) Version () uint64 {
42
- return 20220916000001
43
- }
44
-
45
- func (* doraMigrationScript ) Name () string {
46
- return "dora init schemas including issue lead time metrics"
47
32
}
You can’t perform that action at this time.
0 commit comments