1
0

Ensure consistent naming of title fields (#528)

Remove task text and namespace name in migration

Fix lint

Add migration for namespace title

Fix renaming namespace name to title

Rename namespace name field to title

Drop text column at the end of the migration

Add migration for task text to title

Rename task text to title

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/528
This commit is contained in:
konrad
2020-05-16 10:17:44 +00:00
parent 587ce92dc9
commit fe43173b6c
27 changed files with 476 additions and 248 deletions

View File

@ -49,7 +49,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
// We use individual variables for the tasks here to be able to rearrange or remove ones more easily
task1 := &Task{
ID: 1,
Text: "task #1",
Title: "task #1",
Description: "Lorem Ipsum",
Identifier: "test1-1",
Index: 1,
@ -71,7 +71,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
RelationKindSubtask: {
{
ID: 29,
Text: "task #29 with parent task (1)",
Title: "task #29 with parent task (1)",
Index: 14,
CreatedByID: 1,
ListID: 1,
@ -109,7 +109,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task2 := &Task{
ID: 2,
Text: "task #2 done",
Title: "task #2 done",
Identifier: "test1-2",
Index: 2,
Done: true,
@ -133,7 +133,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task3 := &Task{
ID: 3,
Text: "task #3 high prio",
Title: "task #3 high prio",
Identifier: "test1-3",
Index: 3,
CreatedByID: 1,
@ -147,7 +147,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task4 := &Task{
ID: 4,
Text: "task #4 low prio",
Title: "task #4 low prio",
Identifier: "test1-4",
Index: 4,
CreatedByID: 1,
@ -161,7 +161,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task5 := &Task{
ID: 5,
Text: "task #5 higher due date",
Title: "task #5 higher due date",
Identifier: "test1-5",
Index: 5,
CreatedByID: 1,
@ -175,7 +175,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task6 := &Task{
ID: 6,
Text: "task #6 lower due date",
Title: "task #6 lower due date",
Identifier: "test1-6",
Index: 6,
CreatedByID: 1,
@ -189,7 +189,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task7 := &Task{
ID: 7,
Text: "task #7 with start date",
Title: "task #7 with start date",
Identifier: "test1-7",
Index: 7,
CreatedByID: 1,
@ -203,7 +203,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task8 := &Task{
ID: 8,
Text: "task #8 with end date",
Title: "task #8 with end date",
Identifier: "test1-8",
Index: 8,
CreatedByID: 1,
@ -217,7 +217,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task9 := &Task{
ID: 9,
Text: "task #9 with start and end date",
Title: "task #9 with start and end date",
Identifier: "test1-9",
Index: 9,
CreatedByID: 1,
@ -232,7 +232,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task10 := &Task{
ID: 10,
Text: "task #10 basic",
Title: "task #10 basic",
Identifier: "test1-10",
Index: 10,
CreatedByID: 1,
@ -245,7 +245,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task11 := &Task{
ID: 11,
Text: "task #11 basic",
Title: "task #11 basic",
Identifier: "test1-11",
Index: 11,
CreatedByID: 1,
@ -258,7 +258,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task12 := &Task{
ID: 12,
Text: "task #12 basic",
Title: "task #12 basic",
Identifier: "test1-12",
Index: 12,
CreatedByID: 1,
@ -271,7 +271,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task15 := &Task{
ID: 15,
Text: "task #15",
Title: "task #15",
Identifier: "test6-1",
Index: 1,
CreatedByID: 6,
@ -284,7 +284,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task16 := &Task{
ID: 16,
Text: "task #16",
Title: "task #16",
Identifier: "test7-1",
Index: 1,
CreatedByID: 6,
@ -297,7 +297,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task17 := &Task{
ID: 17,
Text: "task #17",
Title: "task #17",
Identifier: "test8-1",
Index: 1,
CreatedByID: 6,
@ -310,7 +310,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task18 := &Task{
ID: 18,
Text: "task #18",
Title: "task #18",
Identifier: "test9-1",
Index: 1,
CreatedByID: 6,
@ -323,7 +323,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task19 := &Task{
ID: 19,
Text: "task #19",
Title: "task #19",
Identifier: "test10-1",
Index: 1,
CreatedByID: 6,
@ -336,7 +336,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task20 := &Task{
ID: 20,
Text: "task #20",
Title: "task #20",
Identifier: "test11-1",
Index: 1,
CreatedByID: 6,
@ -349,7 +349,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task21 := &Task{
ID: 21,
Text: "task #21",
Title: "task #21",
Identifier: "test12-1",
Index: 1,
CreatedByID: 6,
@ -362,7 +362,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task22 := &Task{
ID: 22,
Text: "task #22",
Title: "task #22",
Identifier: "test13-1",
Index: 1,
CreatedByID: 6,
@ -375,7 +375,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task23 := &Task{
ID: 23,
Text: "task #23",
Title: "task #23",
Identifier: "test14-1",
Index: 1,
CreatedByID: 6,
@ -388,7 +388,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task24 := &Task{
ID: 24,
Text: "task #24",
Title: "task #24",
Identifier: "test15-1",
Index: 1,
CreatedByID: 6,
@ -401,7 +401,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task25 := &Task{
ID: 25,
Text: "task #25",
Title: "task #25",
Identifier: "test16-1",
Index: 1,
CreatedByID: 6,
@ -414,7 +414,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task26 := &Task{
ID: 26,
Text: "task #26",
Title: "task #26",
Identifier: "test17-1",
Index: 1,
CreatedByID: 6,
@ -427,7 +427,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task27 := &Task{
ID: 27,
Text: "task #27 with reminders",
Title: "task #27 with reminders",
Identifier: "test1-12",
Index: 12,
CreatedByID: 1,
@ -441,7 +441,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task28 := &Task{
ID: 28,
Text: "task #28 with repeat after",
Title: "task #28 with repeat after",
Identifier: "test1-13",
Index: 13,
CreatedByID: 1,
@ -455,7 +455,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task29 := &Task{
ID: 29,
Text: "task #29 with parent task (1)",
Title: "task #29 with parent task (1)",
Identifier: "test1-14",
Index: 14,
CreatedByID: 1,
@ -465,7 +465,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
RelationKindParenttask: {
{
ID: 1,
Text: "task #1",
Title: "task #1",
Description: "Lorem Ipsum",
Index: 1,
CreatedByID: 1,
@ -482,7 +482,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task30 := &Task{
ID: 30,
Text: "task #30 with assignees",
Title: "task #30 with assignees",
Identifier: "test1-15",
Index: 15,
CreatedByID: 1,
@ -499,7 +499,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task31 := &Task{
ID: 31,
Text: "task #31 with color",
Title: "task #31 with color",
Identifier: "test1-16",
Index: 16,
HexColor: "f0f0f0",
@ -513,7 +513,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task32 := &Task{
ID: 32,
Text: "task #32",
Title: "task #32",
Identifier: "test3-1",
Index: 1,
CreatedByID: 1,
@ -526,7 +526,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
task33 := &Task{
ID: 33,
Text: "task #33 with percent done",
Title: "task #33 with percent done",
Identifier: "test1-17",
Index: 17,
CreatedByID: 1,