From 06193ed825094581da4fb5550804d7445fc5ae13 Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sun, 6 Sep 2020 17:02:25 +0800 Subject: schemadoc: add go:generate to output database schema (#6310) * schemadoc: add go:generate to output database schema * Check errors * Revert string renames --- internal/db/backup_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/db/backup_test.go') diff --git a/internal/db/backup_test.go b/internal/db/backup_test.go index fafaf28a..a65e6944 100644 --- a/internal/db/backup_test.go +++ b/internal/db/backup_test.go @@ -26,11 +26,11 @@ 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) != 3 { + t.Fatalf("New table has added (want 3 got %d), please add new tests for the table and update this check", len(Tables)) } - db := initTestDB(t, "dumpAndImport", tables...) + db := initTestDB(t, "dumpAndImport", Tables...) setupDBToDump(t, db) dumpTables(t, db) importTables(t, db) @@ -109,7 +109,7 @@ func setupDBToDump(t *testing.T, db *gorm.DB) { func dumpTables(t *testing.T, db *gorm.DB) { t.Helper() - for _, table := range tables { + for _, table := range Tables { tableName := getTableType(table) var buf bytes.Buffer @@ -126,7 +126,7 @@ func dumpTables(t *testing.T, db *gorm.DB) { func importTables(t *testing.T, db *gorm.DB) { t.Helper() - for _, table := range tables { + for _, table := range Tables { tableName := getTableType(table) err := func() error { -- cgit v1.2.3