Added `any` to Database protocol in code examples in ZH language

This commit is contained in:
Holly Schilling 2025-06-13 10:00:10 -05:00 committed by GitHub
parent a17492b57d
commit 1e5dfd492c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -5,11 +5,11 @@
```swift ```swift
// An example migration. // An example migration.
struct MyMigration: Migration { struct MyMigration: Migration {
func prepare(on database: Database) -> EventLoopFuture<Void> { func prepare(on database: any Database) -> EventLoopFuture<Void> {
// Make a change to the database. // Make a change to the database.
} }
func revert(on database: Database) -> EventLoopFuture<Void> { func revert(on database: any Database) -> EventLoopFuture<Void> {
// Undo the change made in `prepare`, if possible. // Undo the change made in `prepare`, if possible.
} }
} }
@ -19,11 +19,11 @@ struct MyMigration: Migration {
```swift ```swift
struct MyMigration: AsyncMigration { struct MyMigration: AsyncMigration {
func prepare(on database: Database) async throws { func prepare(on database: any Database) async throws {
// Make a change to the database. // Make a change to the database.
} }
func revert(on database: Database) async throws { func revert(on database: any Database) async throws {
// Undo the change made in `prepare`, if possible. // Undo the change made in `prepare`, if possible.
} }
} }