mirror of https://github.com/vapor/docs.git
Added `any` to Database protocol in code examples in ZH language
This commit is contained in:
parent
a17492b57d
commit
1e5dfd492c
|
|
@ -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.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue