Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b46d0d6

Browse files
authored
fix: Extend migration fixture test with down and fix 000045 (#6130)
1 parent 049984c commit b46d0d6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ALTER TABLE workspace_builds
2-
ADD COLUMN name character varying(64) NOT NULL;
2+
ADD COLUMN name character varying(64) NOT NULL DEFAULT '';

coderd/database/migrations/migrate_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ func TestMigrateUpWithFixtures(t *testing.T) {
331331
s.Add(table, count)
332332
}
333333
}
334+
335+
// Test that migration down is successful after up.
336+
err = migrations.Down(db)
337+
require.NoError(t, err, "final migration down should be successful")
334338
})
335339
}
336340
}

0 commit comments

Comments
 (0)