File tree Expand file tree Collapse file tree 5 files changed +20
-20
lines changed
Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Original file line number Diff line number Diff 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.
77struct 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
2121struct 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}
Original file line number Diff line number Diff 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.
77struct 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
2121struct 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}
Original file line number Diff line number Diff 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.
77struct 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
2121struct 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}
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ Migraties zijn als een versiebeheersysteem voor uw database. Elke migratie defin
55``` swift
66// Een voorbeeld migratie.
77struct 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
2121struct 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}
Original file line number Diff line number Diff line change 55``` swift
66// An example migration.
77struct 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
2121struct 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}
You can’t perform that action at this time.
0 commit comments