You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/21 07:05:13 UTC

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3764: Issues/3234 add parallelLabels for blueprint/pipeline

likyh commented on code in PR #3764:
URL: https://github.com/apache/incubator-devlake/pull/3764#discussion_r1027640732


##########
models/migrationscripts/20221115_add_parallel_labels.go:
##########
@@ -0,0 +1,69 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"github.com/apache/incubator-devlake/errors"
+	"github.com/apache/incubator-devlake/plugins/core"
+	"time"
+)
+
+type DbPipelineParallelLabel20221115 struct {
+	CreatedAt  time.Time `json:"createdAt"`
+	UpdatedAt  time.Time `json:"updatedAt"`
+	PipelineId uint64    `json:"pipeline_id" gorm:"primaryKey"`
+	Name       string    `json:"name" gorm:"primaryKey"`
+}
+
+func (DbPipelineParallelLabel20221115) TableName() string {
+	return "_devlake_pipeline_parallel_labels"
+}
+
+type DbBlueprintParallelLabel20221115 struct {
+	CreatedAt   time.Time `json:"createdAt"`
+	UpdatedAt   time.Time `json:"updatedAt"`
+	BlueprintId uint64    `json:"blueprint_id" gorm:"primaryKey"`
+	Name        string    `json:"name" gorm:"primaryKey"`
+}
+
+func (DbBlueprintParallelLabel20221115) TableName() string {
+	return "_devlake_blueprint_parallel_labels"
+}
+
+type addParallelLabels struct{}
+
+func (*addParallelLabels) Up(res core.BasicRes) errors.Error {
+	db := res.GetDal()
+	err := db.AutoMigrate(&DbPipelineParallelLabel20221115{})
+	if err != nil {
+		return err
+	}
+	err = db.AutoMigrate(&DbBlueprintParallelLabel20221115{})
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+func (*addParallelLabels) Version() uint64 {
+	return 20221115000034
+}
+
+func (*addParallelLabels) Name() string {
+	return "UpdateSchemas for addParallelLabels"

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org