Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Hotfix for Fluent GM 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Berzan Yildiz committed May 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 22cacbf commit 2ed1564
Showing 5 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -19,13 +19,13 @@ let package = Package(
// 💧 Vapor's ORM Framework.
.package(
url: "https://github.com/vapor/fluent.git",
from: "4.0.0-rc.2"
from: "4.0.0-rc.3"
),

// A database driver for testing.
.package(
url: "https://github.com/vapor/fluent-sqlite-driver.git",
from: "4.0.0-rc.1.1"
from: "4.0.0-rc.2"
)
],
targets: [
2 changes: 1 addition & 1 deletion Sources/Corvus/Endpoints/Restore/Restore.swift
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ public final class Restore<T: CorvusModel>: AuthEndpoint {
public let operationType: OperationType = .patch

/// The timestamp at which the item was soft deleted.
let deletedTimestamp: QuerySubject.Timestamp
let deletedTimestamp: QuerySubject.Timestamp<DefaultTimestampFormat>

/// Initializes the component with a given path parameter.
///
3 changes: 2 additions & 1 deletion Sources/Corvus/Endpoints/Utilities/ReadTarget.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vapor
import Fluent

/// Describes the target of a read operation, either all objects, only existing
/// objects, or only trashed (soft-deleted) objects.
@@ -8,7 +9,7 @@ public struct ReadTarget<T: CorvusModel> {
enum Option<T: CorvusModel> {
case all
case existing
case trashed(T.Timestamp)
case trashed(T.Timestamp<DefaultTimestampFormat>)
}

/// The type of target to be read.
6 changes: 4 additions & 2 deletions Sources/Corvus/Protocols/Models/CorvusModel.swift
Original file line number Diff line number Diff line change
@@ -11,9 +11,11 @@ where IDValue: LosslessStringConvertible {}
public extension CorvusModel {

/// The timestamp at which a `CorvusModel` was soft deleted.
static var deletedTimestamp: Timestamp? {
static var deletedTimestamp: Timestamp<DefaultTimestampFormat>? {
Self().properties
.compactMap({ $0 as? TimestampProperty<Self> })
.compactMap({
$0 as? TimestampProperty<Self, DefaultTimestampFormat>
})
.filter({ $0.trigger == .delete })
.first
}
12 changes: 7 additions & 5 deletions Tests/CorvusTests/CorvusTests.swift
Original file line number Diff line number Diff line change
@@ -40,11 +40,13 @@ class CorvusTests: XCTestCase {
app.middleware.use(CorvusToken.authenticator())
app.middleware.use(CorvusUser.authenticator())

app.migrations.add(CreateAccount())
app.migrations.add(CreateSoloAccount())
app.migrations.add(CreateTransaction())
app.migrations.add(CreateCorvusUser())
app.migrations.add(CreateCorvusToken())
app.migrations.add(
CreateAccount(),
CreateSoloAccount(),
CreateTransaction(),
CreateCorvusUser(),
CreateCorvusToken()
)

try app.autoMigrate().wait()

0 comments on commit 2ed1564

Please sign in to comment.