Skip to content

Commit 2336e61

Browse files
Added any qualifier to code examples on Migrations page (#1083)
Swift 5.6 added the `any` keyword as an existential type qualifier. This PR updates the code examples on the Migrations page to correctly incorporate this keyword. The following languages are effected: EN, ES, NL, IT, and ZH.
1 parent d6eb192 commit 2336e61

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

docs/fluent/migration.es.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Las migraciones son una especie de control de versiones para tu base de datos. C
55
```swift
66
// Una migración de ejemplo.
77
struct MyMigration: Migration {
8-
func prepare(on database: Database) -> EventLoopFuture<Void> {
8+
func prepare(on database: any Database) -> EventLoopFuture<Void> {
99
// Haz un cambio en la base de datos.
1010
}
1111

12-
func revert(on database: Database) -> EventLoopFuture<Void> {
12+
func revert(on database: any Database) -> EventLoopFuture<Void> {
1313
// Deshaz el cambio hecho en `prepare`, si es posible.
1414
}
1515
}
@@ -19,11 +19,11 @@ Si estás usando `async`/`await` deberías implementar el protocolo `AsyncMigrat
1919

2020
```swift
2121
struct MyMigration: AsyncMigration {
22-
func prepare(on database: Database) async throws {
22+
func prepare(on database: any Database) async throws {
2323
// Haz un cambio en la base de datos.
2424
}
2525

26-
func revert(on database: Database) async throws {
26+
func revert(on database: any Database) async throws {
2727
// Deshaz el cambio hecho en `prepare`, si es posible.
2828
}
2929
}

docs/fluent/migration.it.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Le migrazioni sono come un sistema di controllo versione per il tuo database. Og
55
```swift
66
// Un esempio di migrazione.
77
struct MyMigration: Migration {
8-
func prepare(on database: Database) -> EventLoopFuture<Void> {
8+
func prepare(on database: any Database) -> EventLoopFuture<Void> {
99
// Fai una modifica al database.
1010
}
1111

12-
func revert(on database: Database) -> EventLoopFuture<Void> {
12+
func revert(on database: any Database) -> EventLoopFuture<Void> {
1313
// Disfai le modifiche fatte in `prepare`, se possibile.
1414
}
1515
}
@@ -19,11 +19,11 @@ Se usi `async`/`await` devi implementare il protocollo `AsyncMigration`:
1919

2020
```swift
2121
struct MyMigration: AsyncMigration {
22-
func prepare(on database: Database) async throws {
22+
func prepare(on database: any Database) async throws {
2323
// Fai una modifica al database.
2424
}
2525

26-
func revert(on database: Database) async throws {
26+
func revert(on database: any Database) async throws {
2727
// Disfai le modifiche fatte in `prepare`, se possibile.
2828
}
2929
}

docs/fluent/migration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Migrations are like a version control system for your database. Each migration d
55
```swift
66
// An example migration.
77
struct MyMigration: Migration {
8-
func prepare(on database: Database) -> EventLoopFuture<Void> {
8+
func prepare(on database: any Database) -> EventLoopFuture<Void> {
99
// Make a change to the database.
1010
}
1111

12-
func revert(on database: Database) -> EventLoopFuture<Void> {
12+
func revert(on database: any Database) -> EventLoopFuture<Void> {
1313
// Undo the change made in `prepare`, if possible.
1414
}
1515
}
@@ -19,11 +19,11 @@ If you're using `async`/`await` you should implement the `AsyncMigration` protoc
1919

2020
```swift
2121
struct MyMigration: AsyncMigration {
22-
func prepare(on database: Database) async throws {
22+
func prepare(on database: any Database) async throws {
2323
// Make a change to the database.
2424
}
2525

26-
func revert(on database: Database) async throws {
26+
func revert(on database: any Database) async throws {
2727
// Undo the change made in `prepare`, if possible.
2828
}
2929
}

docs/fluent/migration.nl.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Migraties zijn als een versiebeheersysteem voor uw database. Elke migratie defin
55
```swift
66
// Een voorbeeld migratie.
77
struct MyMigration: Migration {
8-
func prepare(on database: Database) -> EventLoopFuture<Void> {
8+
func prepare(on database: any Database) -> EventLoopFuture<Void> {
99
// Breng een wijziging aan in de database.
1010
}
1111

12-
func revert(on database: Database) -> EventLoopFuture<Void> {
12+
func revert(on database: any Database) -> EventLoopFuture<Void> {
1313
// Maak de verandering in `prepare` ongedaan, indien mogelijk.
1414
}
1515
}
@@ -19,11 +19,11 @@ Als je `async`/`await` gebruikt moet je het `AsyncMigration` protocol implemente
1919

2020
```swift
2121
struct MyMigration: AsyncMigration {
22-
func prepare(on database: Database) async throws {
22+
func prepare(on database: any Database) async throws {
2323
// Breng een wijziging aan in de database.
2424
}
2525

26-
func revert(on database: Database) async throws {
26+
func revert(on database: any Database) async throws {
2727
// Maak de verandering in `prepare` ongedaan, indien mogelijk.
2828
}
2929
}

docs/fluent/migration.zh.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
```swift
66
// An example migration.
77
struct MyMigration: Migration {
8-
func prepare(on database: Database) -> EventLoopFuture<Void> {
8+
func prepare(on database: any Database) -> EventLoopFuture<Void> {
99
// Make a change to the database.
1010
}
1111

12-
func revert(on database: Database) -> EventLoopFuture<Void> {
12+
func revert(on database: any Database) -> EventLoopFuture<Void> {
1313
// Undo the change made in `prepare`, if possible.
1414
}
1515
}
@@ -19,11 +19,11 @@ struct MyMigration: Migration {
1919

2020
```swift
2121
struct MyMigration: AsyncMigration {
22-
func prepare(on database: Database) async throws {
22+
func prepare(on database: any Database) async throws {
2323
// Make a change to the database.
2424
}
2525

26-
func revert(on database: Database) async throws {
26+
func revert(on database: any Database) async throws {
2727
// Undo the change made in `prepare`, if possible.
2828
}
2929
}

0 commit comments

Comments
 (0)