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:08 UTC

[incubator-devlake] 03/13: fix: update schema

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 5cedd9e6fc847c0647af6c31831e1bf411758077
Author: xgdyp <zx...@163.com>
AuthorDate: Fri Jul 15 13:41:49 2022 +0800

    fix: update schema
---
 models/domainlayer/code/commit.go                |  1 -
 models/migrationscripts/updateSchemas20220711.go | 11 ++++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/models/domainlayer/code/commit.go b/models/domainlayer/code/commit.go
index 1d777624..9b20cd3b 100644
--- a/models/domainlayer/code/commit.go
+++ b/models/domainlayer/code/commit.go
@@ -50,7 +50,6 @@ type CommitFile struct {
 	FilePath  string `gorm:"primaryKey;type:varchar(255)"`
 	Additions int
 	Deletions int
-	Component string `gorm:"type:varchar(255)"`
 }
 
 func (CommitFile) TableName() string {
diff --git a/models/migrationscripts/updateSchemas20220711.go b/models/migrationscripts/updateSchemas20220711.go
index 7df8df0e..f2c3f499 100644
--- a/models/migrationscripts/updateSchemas20220711.go
+++ b/models/migrationscripts/updateSchemas20220711.go
@@ -44,11 +44,12 @@ func (FileComponent) TableName() string {
 
 type CommitFile struct {
 	common.NoPKModel
-	CommitSha string `gorm:"primaryKey;type:varchar(40)"`
-	FilePath  string `gorm:"primaryKey;type:varchar(255)"`
-	Additions int
-	Deletions int
-	Component string `gorm:"type:varchar(255)"`
+	CommitFileID string `gorm:"primaryKey;"`
+	CommitSha    string `gorm:"primaryKey;type:varchar(40)"`
+	FilePath     string `gorm:"primaryKey;type:varchar(255)"`
+	Additions    int
+	Deletions    int
+	Component    string `gorm:"type:varchar(255)"`
 }
 
 func (CommitFile) TableName() string {