6.7.0 Migration issue `has no column named`

I'm adding a new migration:

        migrator.registerMigration("1.0.1") { db in
            
            try db.alter(table: "mbyuser", body: { t in
                t.add(column: "username", .text)
                t.add(column: "mobileNumber", .text)
            })
        }

But I'm getting a crash at startup:

2023-07-24 22:01:08.636110-0500 Markably[65066:442647] [logging] table mbyUser has no column named username in "INSERT INTO "mbyUser" ("id", "avatar", "email", "username", "mobileNumber", "isAdmin", "isDeleted", "isOnboarded", "isPermanentlyDeleted", "clientPreferences", "gender", "birthdate", "isSubscribedToMarketingNotifications", "billingSubscriptionStripe", "billingSubscriptionStorekit", "isSuspended", "firstName", "lastName", "seats", "tasks", "courseCodes", "insertedAt", "updatedAt", "confirmedAt") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"

I'm not sure why this might be as I extend the MutablePersistableRecord with username and mobileNumber

extension MbyUser: FetchableRecord, MutablePersistableRecord {
    enum Columns {
        static let id = Column("id")
        static let avatar = Column("avatar")
        static let email = Column("email")
        static let username = Column("username")
        static let mobileNumber = Column("mobileNumber")
...

Along with the corresponding class fields:

public struct MbyUser: Identifiable, Codable {
    public var id: String
    public var avatar: String?
    public var email: String
    public var username: String?
    public var mobileNumber: String?
...

Any suggestions as to why I'm getting this startup crash?

Replying to my own thread with the solution.

I made a terrible design decision where I made a migration called "fixtures" where it would generate the demo data for the app. Unfortunately this meant that any alterations to the tables related to the fixture data after that would always "lose" to the race condition I created with the "fixtures" migration.

So the solution was to remove the fixtures migration entirely and then AFTER the migrator was complete make a function that would generate the fixtures.

Glad you could solve the issue :slightly_smiling_face: