aboutsummaryrefslogtreecommitdiffstats
path: root/internal/models/migration_test.go
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-11-13 22:20:16 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-11-13 22:20:16 -0800
commit7026e3861a5712ced6f2006f282c8386b4db106e (patch)
tree18db906e76c1736a831f345b4832db91964c960a /internal/models/migration_test.go
parentRemove timestamp version style in favor of always using sequential (diff)
downloadcli-7026e3861a5712ced6f2006f282c8386b4db106e.zip
Pad new migrations to 4 digits
Diffstat (limited to 'internal/models/migration_test.go')
-rw-r--r--internal/models/migration_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/models/migration_test.go b/internal/models/migration_test.go
index 87b98e4..91aed2e 100644
--- a/internal/models/migration_test.go
+++ b/internal/models/migration_test.go
@@ -10,13 +10,13 @@ import (
func TestNewMigration(t *testing.T) {
m := models.NewMigration(1, "test message")
- check.Equal(t, m.Version, "001")
+ check.Equal(t, m.Version, "0001")
check.Equal(t, m.Message, "test message")
check.Equal(t, m.Applied, false)
m = models.NewMigration(100, "test message")
- check.Equal(t, m.Version, "100")
+ check.Equal(t, m.Version, "0100")
check.Equal(t, m.Message, "test message")
check.Equal(t, m.Applied, false)
}
@@ -31,12 +31,12 @@ func TestName(t *testing.T) {
// Underscores are used to separate version and message.
{
migration: models.NewMigration(1, "test_message"),
- expectedName: "001_test_message",
+ expectedName: "0001_test_message",
},
// Leading/Trailing spaces trimmed, lowercased, and spaces converted to underscores.
{
migration: models.NewMigration(1, " teST mesSAGE "),
- expectedName: "001_test_message",
+ expectedName: "0001_test_message",
},
}