New:
- #376 Referential actions are now supported for
ReferenceSupportingdatabases.
try builder.addReference(from: \.ownerID, to: \User.id, actions: ReferentialActions(update: .update, delete: .prevent))- #376 Auto migration is now available via a static method on
Model where Database: SchemaSupporting. This will allow for easier customization of migrations.
extension Pet: Migration {
/// See `Migration.prepare(on:)`
public static func prepare(on connection: Database.Connection) -> Future<Void> {
return Database.create(self, on: connection) { builder in
try addProperties(to: builder)
try builder.addReference(from: \.ownerID, to: \User.id)
}
}
}- #371 Added CRUD operations for
Future where T: Model
let user: Future<User> = ...
user.save(on: ...)- #372
structs can now be conformed toModel
Fixes
SoftDeletablemodels can now be saved- Several missing overloads added to
QueryBuilderoperators and methods - Several fixes to relations and joins