Skip to content

Commit eea3a44

Browse files
authored
Merge pull request #76 from MihaelIsaev/master
Allow to create model with pre-given UUID idKey
2 parents b5da9d5 + d3aef45 commit eea3a44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FluentPostgreSQL/PostgreSQLDatabase+QuerySupporting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extension PostgreSQLDatabase: QuerySupporting {
105105
{
106106
switch event {
107107
case .willCreate:
108-
if M.ID.self == UUID.self {
108+
if M.ID.self == UUID.self, model.fluentID == nil {
109109
var model = model
110110
model.fluentID = UUID() as? M.ID
111111
return conn.future(model)

0 commit comments

Comments
 (0)