Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
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/core/context"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
)

var _ plugin.MigrationScript = (*addConnectionIdToAsanaScopeConfigs)(nil)

// asanaScopeConfig20250219 adds connection_id and name to match common.ScopeConfig.
// The init migration used archived.ScopeConfig which did not have these columns.
type asanaScopeConfig20250219 struct {
ConnectionId uint64 `json:"connectionId" gorm:"index" mapstructure:"connectionId,omitempty"`
Name string `mapstructure:"name" json:"name" gorm:"type:varchar(255);uniqueIndex"`
}

func (asanaScopeConfig20250219) TableName() string {
return "_tool_asana_scope_configs"
}

type addConnectionIdToAsanaScopeConfigs struct{}

func (*addConnectionIdToAsanaScopeConfigs) Up(basicRes context.BasicRes) errors.Error {
return basicRes.GetDal().AutoMigrate(&asanaScopeConfig20250219{})
}

func (*addConnectionIdToAsanaScopeConfigs) Version() uint64 {
return 20250219000001
}

func (*addConnectionIdToAsanaScopeConfigs) Name() string {
return "add connection_id and name to _tool_asana_scope_configs"
}
1 change: 1 addition & 0 deletions backend/plugins/asana/models/migrationscripts/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ func All() []plugin.MigrationScript {
new(addMissingTables),
new(addTaskTransformationFields),
new(addScopeConfigIssueTypeFields),
new(addConnectionIdToAsanaScopeConfigs),
}
}