Postgres connected vapor

vapor
func create(req: Request) throws -> EventLoopFuture<Room> {
let room = try req.content.decode(Room.self)
return room.create(on: req.db).map { room }
}
server: id of relation violates not-null constraint (ExecConstraints)
final class Room: Codable, Model, Content {
static let schema: String = "rooms"
@ID(custom: "id")
var id: Int?
........
func prepare(on database: Database) -> EventLoopFuture<Void> {
return database.schema("rooms")
.id()
@ID(key: .id)     
var id: UUID?

--

--

--

Depths of ocean could not swallow me.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Engage Optical Mouse Driver

Agile Best Practices for Next Level Results

Go: Common Misconceptions About Goroutines

CSS: Grid

Scallop News Episode 003

Flutter Vs Iconic — Which One Works For You? | Xicom

CS 373: Zelma Garza #7

{UPDATE} Gym Fit to Fat Race - real run jump-ing & wrestle boxing games for kids!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sis Ccr

Sis Ccr

Depths of ocean could not swallow me.

More from Medium

Observation are glorified GO-TO statements

November 2021

Advent of Code 2021: Postmortem

How we customize and deliver our mobile app templates with fastlane & Jenkins