From 2eaf1d693ae08c0312dd1f977f81675f418f3770 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Tue, 6 Oct 2020 15:43:28 +0800 Subject: db: migrate access table to use GORM (#6371) --- internal/db/backup_test.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'internal/db/backup_test.go') diff --git a/internal/db/backup_test.go b/internal/db/backup_test.go index 27688889..4bbef8f6 100644 --- a/internal/db/backup_test.go +++ b/internal/db/backup_test.go @@ -29,8 +29,8 @@ func Test_dumpAndImport(t *testing.T) { t.Parallel() - if len(Tables) != 3 { - t.Fatalf("New table has added (want 3 got %d), please add new tests for the table and update this check", len(Tables)) + if len(Tables) != 4 { + t.Fatalf("New table has added (want 4 got %d), please add new tests for the table and update this check", len(Tables)) } db := initTestDB(t, "dumpAndImport", Tables...) @@ -46,6 +46,19 @@ func setupDBToDump(t *testing.T, db *gorm.DB) { t.Helper() vals := []interface{}{ + &Access{ + ID: 1, + UserID: 1, + RepoID: 11, + Mode: AccessModeRead, + }, + &Access{ + ID: 2, + UserID: 2, + RepoID: 22, + Mode: AccessModeWrite, + }, + &AccessToken{ UserID: 1, Name: "test1", -- cgit v1.2.3