Added `any` to Database protocol in Example code in Spanish

This commit is contained in:
Holly Schilling 2025-06-13 09:56:37 -05:00 committed by GitHub
parent 4cd24414b2
commit f0a6e8a5ca
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 @@ Las migraciones son una especie de control de versiones para tu base de datos. C
```swift ```swift
// Una migración de ejemplo. // Una migración de ejemplo.
struct MyMigration: Migration { struct MyMigration: Migration {
func prepare(on database: Database) -> EventLoopFuture<Void> { func prepare(on database: any Database) -> EventLoopFuture<Void> {
// Haz un cambio en la base de datos. // Haz un cambio en la base de datos.
} }
func revert(on database: Database) -> EventLoopFuture<Void> { func revert(on database: any Database) -> EventLoopFuture<Void> {
// Deshaz el cambio hecho en `prepare`, si es posible. // Deshaz el cambio hecho en `prepare`, si es posible.
} }
} }
@ -19,11 +19,11 @@ Si estás usando `async`/`await` deberías implementar el protocolo `AsyncMigrat
```swift ```swift
struct MyMigration: AsyncMigration { struct MyMigration: AsyncMigration {
func prepare(on database: Database) async throws { func prepare(on database: any Database) async throws {
// Haz un cambio en la base de datos. // Haz un cambio en la base de datos.
} }
func revert(on database: Database) async throws { func revert(on database: any Database) async throws {
// Deshaz el cambio hecho en `prepare`, si es posible. // Deshaz el cambio hecho en `prepare`, si es posible.
} }
} }