fix(lagoon): migrate:status reads the sets migrate applies (WR-12)
This commit is contained in:
@@ -359,9 +359,16 @@ func TestDocsMigrate(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The framework's own sets come first (WR-12), then the plugin.
|
||||
framework := []string{"summercms.attach", "summercms.cabana", lagoon.DeferredHistoryID, lagoon.QueueHistoryID}
|
||||
want := "acme.blog summer_migrations_acme_blog [20260101000100_create_posts 20260101000200_create_comments_and_categories]"
|
||||
if len(lines) != 1 || lines[0] != want {
|
||||
t.Fatalf("status = %q, want %q", lines, want)
|
||||
if len(lines) != len(framework)+1 || lines[len(lines)-1] != want {
|
||||
t.Fatalf("status = %q, want the framework sets and then %q", lines, want)
|
||||
}
|
||||
for i, id := range framework {
|
||||
if !strings.HasPrefix(lines[i], id+" ") {
|
||||
t.Errorf("status line %d = %q, want the framework set %s", i, lines[i], id)
|
||||
}
|
||||
}
|
||||
if db.Migrator().HasTable("acme_blog_comments") {
|
||||
t.Fatal("rollback left acme_blog_comments")
|
||||
|
||||
Reference in New Issue
Block a user