diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-10-06 15:43:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 15:43:28 +0800 |
commit | 2eaf1d693ae08c0312dd1f977f81675f418f3770 (patch) | |
tree | b42a26180e813918a05a676bd18e13a3a1bb73ec /internal/db/backup_test.go | |
parent | a92d818aa35583594a6b3098f4e1e1f4edec17dd (diff) |
db: migrate access table to use GORM (#6371)
Diffstat (limited to 'internal/db/backup_test.go')
-rw-r--r-- | internal/db/backup_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
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", |