1
0

feat(migration): use new structure for migration

This commit is contained in:
kolaente
2022-12-29 18:11:15 +01:00
parent fef253312c
commit 386e218b95
8 changed files with 44 additions and 44 deletions

View File

@ -259,15 +259,15 @@ func getMicrosoftTodoData(token string) (microsoftTodoData []*project, err error
return
}
func convertMicrosoftTodoData(todoData []*project) (vikunjsStructure []*models.NamespaceWithProjectsAndTasks, err error) {
func convertMicrosoftTodoData(todoData []*project) (vikunjsStructure []*models.ProjectWithTasksAndBuckets, err error) {
// One namespace with all projects
vikunjsStructure = []*models.NamespaceWithProjectsAndTasks{
vikunjsStructure = []*models.ProjectWithTasksAndBuckets{
{
Namespace: models.Namespace{
Project: models.Project{
Title: "Migrated from Microsoft Todo",
},
Projects: []*models.ProjectWithTasksAndBuckets{},
ChildProjects: []*models.ProjectWithTasksAndBuckets{},
},
}
@ -364,7 +364,7 @@ func convertMicrosoftTodoData(todoData []*project) (vikunjsStructure []*models.N
log.Debugf("[Microsoft Todo Migration] Done converted %d tasks", len(l.Tasks))
}
vikunjsStructure[0].Projects = append(vikunjsStructure[0].Projects, project)
vikunjsStructure[0].ChildProjects = append(vikunjsStructure[0].ChildProjects, project)
log.Debugf("[Microsoft Todo Migration] Done converting project %s", l.ID)
}