diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 115153c..71f4d6e 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -66,7 +66,7 @@ private func setupDatabase( let databaseClient = makeDatabaseClient(app.db) if app.environment != .testing { - try await app.migrations.add(databaseClient.migrations.run()) + try await app.migrations.add(databaseClient.migrations()) } return databaseClient diff --git a/Sources/DatabaseClient/Interface.swift b/Sources/DatabaseClient/Interface.swift index b003db9..7fe5073 100644 --- a/Sources/DatabaseClient/Interface.swift +++ b/Sources/DatabaseClient/Interface.swift @@ -55,6 +55,10 @@ extension DatabaseClient { @DependencyClient public struct Migrations: Sendable { public var run: @Sendable () async throws -> [any AsyncMigration] + + public func callAsFunction() async throws -> [any AsyncMigration] { + try await self.run() + } } }