diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-09-06 17:02:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 17:02:25 +0800 |
commit | 06193ed825094581da4fb5550804d7445fc5ae13 (patch) | |
tree | bd2d966235a224b9d28d316ef915481a63fac5f9 /internal/db/backup_test.go | |
parent | 519e59b5778571ace3f681b81a21b92a38ede890 (diff) |
schemadoc: add go:generate to output database schema (#6310)
* schemadoc: add go:generate to output database schema
* Check errors
* Revert string renames
Diffstat (limited to 'internal/db/backup_test.go')
-rw-r--r-- | internal/db/backup_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 { |