Skip to content

Commit

Permalink
fix EventRequest table migration issue for eventCount default value
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrahul43 committed Apr 19, 2024
1 parent 9dc23bc commit 0747439
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ extension EventRequest: DatabasePersistable {
t.column("data", .blob)
t.column("retriesMade", .text).notNull()
t.column("createdTimestamp", .datetime).notNull()
t.column("eventCount", .integer).notNull()
}
}
}
Expand All @@ -89,9 +90,12 @@ extension EventRequest: DatabasePersistable {
}

let addsEventCount: (TableAlteration) -> Void = { t in
t.add(column: "eventCount", .integer)
t.add(column: "eventCount", .integer).notNull().defaults(to: 0)
}

return [("addsIsInternalToEventRequest", addsIsInternal), ("addsEventTypeToEventRequest", addsEventType), ("addsEventCountToEventRequest", addsEventCount)]
return [("addsIsInternalToEventRequest", addsIsInternal),
("addsEventTypeToEventRequest", addsEventType),
("addsEventCountToEventRequest", addsEventCount)
]
}
}

0 comments on commit 0747439

Please sign in to comment.