Closed jbehrens94 closed 3 years ago
@jbehrens94 This happens because you are trying to use and auto-incrementing identifier of UUID type (.identifier(auto: true)
). If you set auto: false
it should work.
By the way, you could simplify the property like so:
@ID
var id: UUID?
and the migration:
.id()
Hi all, thank you very much for your work on the Postgres driver for Vapor! I'm running into issues with a Postgres 13.0 (latest from homebrew) database, and Vapor, while using UUID id's.
I declared the ID field as such:
With a migration that uses:
The Postgres driver is setup like this:
Which results in the error:
[ ERROR ] identity column type must be smallint, integer, or bigint (init_params) Fatal error: Error raised at top level: previousError(server: identity column type must be smallint, integer, or bigint (init_params)): file /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1103.8.25.8/swift/stdlib/public/core/ErrorType.swift, line 200