-
-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
The following is saved, but the ID that is saved to the database is not caa3ca53-c330-442d-a98b-53a1d918cd49. It is some other random ID provided by vapor.
extension DummyData: Migration {
typealias Database = PostgreSQLDatabase
static func prepare(on connection: PostgreSQLConnection) -> Future<Void> {
let user = User(id:UUID("caa3ca53-c330-442d-a98b-53a1d918cd49"),
firstName: "test",
lastName: "user",
email: "testuser@gmail.com",
password: "password",
birthDate: "1994-01-02")
return user.create(on: connection).transform(to: ())
}
}the class
final class User: Content {
var id: UUID?
let firstName: String
let lastName: String
var email: String
var password: String
let birthDate: String?
var dateCreated: Date?
var dateUpdated: Date?
init(id: User.ID? = nil, firstName: String, lastName: String, email: String, password: String, birthDate: String?) {
self.id = id
self.firstName = firstName
self.lastName = lastName
self.email = email
self.birthDate = birthDate
self.password = password
}
}my resolved file
``` { "object": { "pins": [ { "package": "Auth", "repositoryURL": "https://github.com/vapor/auth.git", "state": { "branch": null, "revision": "b84242ee3d450516b050f7a64fc0b81604f56077", "version": "2.0.0-rc.4.1" } }, { "package": "Console", "repositoryURL": "https://github.com/vapor/console.git", "state": { "branch": null, "revision": "5b9796d39f201b3dd06800437abd9d774a455e57", "version": "3.0.2" } }, { "package": "Core", "repositoryURL": "https://github.com/vapor/core.git", "state": { "branch": null, "revision": "a909eccc41941faac6fb9e511cdb9a5cb30a05de", "version": "3.1.7" } }, { "package": "Crypto", "repositoryURL": "https://github.com/vapor/crypto.git", "state": { "branch": null, "revision": "1b8c2ba5a42f1adf2aa812204678d8b16466fa59", "version": "3.1.2" } }, { "package": "DatabaseKit", "repositoryURL": "https://github.com/vapor/database-kit.git", "state": { "branch": null, "revision": "0db303439e5ef8b6df50a2b6c4029edddee90cb0", "version": "1.0.1" } }, { "package": "Fluent", "repositoryURL": "https://github.com/vapor/fluent.git", "state": { "branch": null, "revision": "8f22ef2dfeb278179a2d6e91769a5c1ceccf31ef", "version": "3.0.0-rc.2.4.1" } }, { "package": "FluentPostgreSQL", "repositoryURL": "https://github.com/vapor/fluent-postgresql.git", "state": { "branch": null, "revision": "8324bf0fc1437701f8963fb340c199c66079c90e", "version": "1.0.0-rc.2.3" } }, { "package": "HTTP", "repositoryURL": "https://github.com/vapor/http.git", "state": { "branch": null, "revision": "5e766f72d81ef5fe8805d704efdffd17e4906134", "version": "3.0.6" } }, { "package": "Multipart", "repositoryURL": "https://github.com/vapor/multipart.git", "state": { "branch": null, "revision": "7778dcb62f3efa845e8e2808937bb347575ba7ce", "version": "3.0.1" } }, { "package": "PostgreSQL", "repositoryURL": "https://github.com/vapor/postgresql.git", "state": { "branch": null, "revision": "4988607c3b2369248c6cfcd34274241a8632cd69", "version": "1.0.0-rc.2.2.1" } }, { "package": "Routing", "repositoryURL": "https://github.com/vapor/routing.git", "state": { "branch": null, "revision": "3219e328491b0853b8554c5a694add344d2c6cfb", "version": "3.0.1" } }, { "package": "Service", "repositoryURL": "https://github.com/vapor/service.git", "state": { "branch": null, "revision": "281a70b69783891900be31a9e70051b6fe19e146", "version": "1.0.0" } }, { "package": "SQL", "repositoryURL": "https://github.com/vapor/sql.git", "state": { "branch": null, "revision": "1bb94271d8645b6d6983721080ad642aa35d749c", "version": "1.0.0" } }, { "package": "swift-nio", "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, "revision": "a5db2a67515ad2b490ac5646db204a5edf939f47", "version": "1.6.1" } }, { "package": "swift-nio-ssl", "repositoryURL": "https://github.com/apple/swift-nio-ssl.git", "state": { "branch": null, "revision": "38955a5f806a952daf2b16fbfe9aa529749cf1dd", "version": "1.1.0" } }, { "package": "swift-nio-ssl-support", "repositoryURL": "https://github.com/apple/swift-nio-ssl-support.git", "state": { "branch": null, "revision": "c02eec4e0e6d351cd092938cf44195a8e669f555", "version": "1.0.0" } }, { "package": "swift-nio-zlib-support", "repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git", "state": { "branch": null, "revision": "37760e9a52030bb9011972c5213c3350fa9d41fd", "version": "1.0.0" } }, { "package": "TemplateKit", "repositoryURL": "https://github.com/vapor/template-kit.git", "state": { "branch": null, "revision": "43b57b5861d5181b906ac6411d28645e980bb638", "version": "1.0.1" } }, { "package": "URLEncodedForm", "repositoryURL": "https://github.com/vapor/url-encoded-form.git", "state": { "branch": null, "revision": "57cf7fb9c1a1014c50bc05123684a9139ad44127", "version": "1.0.3" } }, { "package": "Validation", "repositoryURL": "https://github.com/vapor/validation.git", "state": { "branch": null, "revision": "ab6c5a352d97c8687b91ed4963aef8e7cfe0795b", "version": "2.0.0" } }, { "package": "Vapor", "repositoryURL": "https://github.com/vapor/vapor.git", "state": { "branch": null, "revision": "8c73eebf7c41c7d8bf83ff87f550e0f97d6aadc4", "version": "3.0.2" } }, { "package": "WebSocket", "repositoryURL": "https://github.com/vapor/websocket.git", "state": { "branch": null, "revision": "141cb4d3814dc8062cb0b2f43e72801b5dfcf272", "version": "1.0.1" } } ] }, "version": 1 } ```MihaelIsaev and addisonwebb
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working