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

This commit is contained in:
Holly Schilling 2025-06-13 09:58:59 -05:00 committed by GitHub
parent f72e95479f
commit a17492b57d
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 @@ Le migrazioni sono come un sistema di controllo versione per il tuo database. Og
```swift
// Un esempio di migrazione.
struct MyMigration: Migration {
func prepare(on database: Database) -> EventLoopFuture<Void> {
func prepare(on database: any Database) -> EventLoopFuture<Void> {
// Fai una modifica al database.
}
func revert(on database: Database) -> EventLoopFuture<Void> {
func revert(on database: any Database) -> EventLoopFuture<Void> {
// Disfai le modifiche fatte in `prepare`, se possibile.
}
}
@ -19,11 +19,11 @@ Se usi `async`/`await` devi implementare il protocollo `AsyncMigration`:
```swift
struct MyMigration: AsyncMigration {
func prepare(on database: Database) async throws {
func prepare(on database: any Database) async throws {
// Fai una modifica al database.
}
func revert(on database: Database) async throws {
func revert(on database: any Database) async throws {
// Disfai le modifiche fatte in `prepare`, se possibile.
}
}