You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2022/07/22 09:40:14 UTC

[incubator-devlake] 09/13: fix: change component model to a new file and rename some file

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 0cd5024706849dfc5eaf489761550bd0242b8762
Author: xgdyp <zx...@163.com>
AuthorDate: Thu Jul 21 15:09:50 2022 +0800

    fix: change component model to a new file and rename some file
---
 models/domainlayer/code/commit.go                  | 10 --------
 models/domainlayer/code/component.go               | 28 ++++++++++++++++++++++
 ...mponent.go => 20220721_commitfile_component.go} |  2 +-
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/models/domainlayer/code/commit.go b/models/domainlayer/code/commit.go
index fd5707a1..73145539 100644
--- a/models/domainlayer/code/commit.go
+++ b/models/domainlayer/code/commit.go
@@ -57,16 +57,6 @@ func (CommitFile) TableName() string {
 	return "commit_files"
 }
 
-type Component struct {
-	RepoId    string `gorm:"type:varchar(255)"`
-	Name      string `gorm:"primaryKey;type:varchar(255)"`
-	PathRegex string `gorm:"type:varchar(255)"`
-}
-
-func (Component) TableName() string {
-	return "components"
-}
-
 type CommitFileComponent struct {
 	common.NoPKModel
 	CommitFileId  string `gorm:"primaryKey;type:varchar(255)"`
diff --git a/models/domainlayer/code/component.go b/models/domainlayer/code/component.go
new file mode 100644
index 00000000..515f422a
--- /dev/null
+++ b/models/domainlayer/code/component.go
@@ -0,0 +1,28 @@
+/*
+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 code
+
+type Component struct {
+	RepoId    string `gorm:"type:varchar(255)"`
+	Name      string `gorm:"primaryKey;type:varchar(255)"`
+	PathRegex string `gorm:"type:varchar(255)"`
+}
+
+func (Component) TableName() string {
+	return "components"
+}
diff --git a/models/migrationscripts/commitfile_component.go b/models/migrationscripts/20220721_commitfile_component.go
similarity index 98%
rename from models/migrationscripts/commitfile_component.go
rename to models/migrationscripts/20220721_commitfile_component.go
index 9f1ee69c..dc3ff8e6 100644
--- a/models/migrationscripts/commitfile_component.go
+++ b/models/migrationscripts/20220721_commitfile_component.go
@@ -69,7 +69,7 @@ func (*commitfileComponent) Up(ctx context.Context, db *gorm.DB) error {
 }
 
 func (*commitfileComponent) Version() uint64 {
-	return 202207201009
+	return 202207211505
 }
 
 func (*commitfileComponent) Name() string {