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

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


The following commit(s) were added to refs/heads/fix#7088 by this push:
     new 576b14ae7 fix: modify deployable_commit_title from varchar255 to text
576b14ae7 is described below

commit 576b14ae7dc7de30b2ca38f6cb8c186e2525471e
Author: abeizn <[email protected]>
AuthorDate: Tue Mar 5 10:32:15 2024 +0800

    fix: modify deployable_commit_title from varchar255 to text
---
 backend/plugins/gitlab/models/deployment.go        |  2 +-
 ...0240305_modify_deployment_commit_title_type.go} | 49 +++++++++++-----------
 .../gitlab/models/migrationscripts/register.go     |  1 +
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/backend/plugins/gitlab/models/deployment.go 
b/backend/plugins/gitlab/models/deployment.go
index cc79c07f5..06b7067ee 100644
--- a/backend/plugins/gitlab/models/deployment.go
+++ b/backend/plugins/gitlab/models/deployment.go
@@ -46,7 +46,7 @@ type GitlabDeployment struct {
        DeployableCommitID          string     `json:"deployable_commit_id" 
gorm:"type:varchar(255)"`
        DeployableCommitMessage     string     
`json:"deployable_commit_message"`
        DeployableCommitShortID     string     
`json:"deployable_commit_short_id" gorm:"type:varchar(255)"`
-       DeployableCommitTitle       string     `json:"deployable_commit_title" 
gorm:"type:varchar(255)"`
+       DeployableCommitTitle       string     `json:"deployable_commit_title"`
 
        //DeployableCoverage   any       `json:"deployable_coverage"`
        DeployableCreatedAt  *time.Time `json:"deployable_created_at"`
diff --git a/backend/plugins/gitlab/models/migrationscripts/register.go 
b/backend/plugins/gitlab/models/migrationscripts/20240305_modify_deployment_commit_title_type.go
similarity index 52%
copy from backend/plugins/gitlab/models/migrationscripts/register.go
copy to 
backend/plugins/gitlab/models/migrationscripts/20240305_modify_deployment_commit_title_type.go
index c82c09db3..b6a9ceade 100644
--- a/backend/plugins/gitlab/models/migrationscripts/register.go
+++ 
b/backend/plugins/gitlab/models/migrationscripts/20240305_modify_deployment_commit_title_type.go
@@ -18,32 +18,31 @@ limitations under the License.
 package migrationscripts
 
 import (
+       "github.com/apache/incubator-devlake/core/context"
+       "github.com/apache/incubator-devlake/core/errors"
        "github.com/apache/incubator-devlake/core/plugin"
 )
 
-// All return all the migration scripts
-func All() []plugin.MigrationScript {
-       return []plugin.MigrationScript{
-               new(addInitTables),
-               new(addGitlabCI),
-               new(addPipelineID),
-               new(addPipelineProjects),
-               new(fixDurationToFloat8),
-               new(addTransformationRule20221125),
-               new(addStdTypeToIssue221230),
-               new(addIsDetailRequired20230210),
-               new(addConnectionIdToTransformationRule),
-               new(addGitlabCommitAuthorInfo),
-               new(addTypeEnvToPipeline),
-               new(renameTr2ScopeConfig),
-               new(addGitlabIssueAssignee),
-               new(addMrCommitSha),
-               new(addRawParamTableForScope),
-               new(addProjectArchived),
-               new(addDeployment),
-               new(addEnvNamePattern),
-               new(addQueuedDuration20231129),
-               new(modifyDeploymentMessageType),
-               new(addTimeToGitlabPipelineProject),
-       }
+var _ plugin.MigrationScript = (*modifyDeploymentCommitTitle)(nil)
+
+type modifyDeploymentCommitTitle struct{}
+
+type deployment20240305 struct {
+       DeployableCommitTitle string `json:"deployable_commit_title"`
+}
+
+func (deployment20240305) TableName() string {
+       return "_tool_gitlab_deployments"
+}
+
+func (script *modifyDeploymentCommitTitle) Up(basicRes context.BasicRes) 
errors.Error {
+       return basicRes.GetDal().AutoMigrate(&deployment20240305{})
+}
+
+func (*modifyDeploymentCommitTitle) Version() uint64 {
+       return 20240305155129
+}
+
+func (*modifyDeploymentCommitTitle) Name() string {
+       return "modify _tool_gitlab_deployments deployable_commit_title from 
varchar to text"
 }
diff --git a/backend/plugins/gitlab/models/migrationscripts/register.go 
b/backend/plugins/gitlab/models/migrationscripts/register.go
index c82c09db3..0ec893727 100644
--- a/backend/plugins/gitlab/models/migrationscripts/register.go
+++ b/backend/plugins/gitlab/models/migrationscripts/register.go
@@ -45,5 +45,6 @@ func All() []plugin.MigrationScript {
                new(addQueuedDuration20231129),
                new(modifyDeploymentMessageType),
                new(addTimeToGitlabPipelineProject),
+               new(modifyDeploymentCommitTitle),
        }
 }

Reply via email to