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/09 09:23:31 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #3703: feat: modifity refs_commits_diffs table name and struct

klesh commented on code in PR #3703:
URL: https://github.com/apache/incubator-devlake/pull/3703#discussion_r1017674630


##########
models/migrationscripts/20221109_modfiy_commits_diffs.go:
##########
@@ -0,0 +1,99 @@
+/*
+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/helpers/migrationhelper"
+	"github.com/apache/incubator-devlake/plugins/core"
+)
+
+var _ core.MigrationScript = (*modifyCommitsDiffs)(nil)
+
+type modifyCommitsDiffs struct{}
+
+// initial format
+type RefsCommitsDiff20221109 struct {
+	NewRefId        string `gorm:"primaryKey;type:varchar(255)"`
+	OldRefId        string `gorm:"primaryKey;type:varchar(255)"`
+	CommitSha       string `gorm:"primaryKey;type:varchar(40)"`
+	NewRefCommitSha string `gorm:"type:varchar(40)"`
+	OldRefCommitSha string `gorm:"type:varchar(40)"`
+	SortingIndex    int
+}
+
+func (RefsCommitsDiff20221109) TableName() string {
+	return "refs_commits_diffs"
+}
+
+// updated format
+
+type CommitsStatus20221109 struct {
+	NewRefCommitSha string `gorm:"primaryKey;type:varchar(40)"`

Review Comment:
   `Ref` represent `tag`/`branch`, not needed anymore.
   The same apply to the rest of the source code



##########
models/migrationscripts/20221109_modfiy_commits_diffs.go:
##########
@@ -0,0 +1,99 @@
+/*
+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/helpers/migrationhelper"
+	"github.com/apache/incubator-devlake/plugins/core"
+)
+
+var _ core.MigrationScript = (*modifyCommitsDiffs)(nil)
+
+type modifyCommitsDiffs struct{}
+
+// initial format
+type RefsCommitsDiff20221109 struct {

Review Comment:
   What does it do? I don't see any references to this struct.



-- 
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