28 lines
666 B
Swift
28 lines
666 B
Swift
import DatabaseClient
|
|
import FluentKit
|
|
import SharedModels
|
|
|
|
public extension DatabaseClient {
|
|
|
|
/// Create the live database client.
|
|
static func live(database: any Database) -> Self {
|
|
.init(
|
|
employees: .live(database: database),
|
|
migrations: {
|
|
[
|
|
Employee.Migrate(),
|
|
PurchaseOrder.Migrate(),
|
|
User.Migrate(),
|
|
User.Token.Migrate(),
|
|
VendorBranch.Migrate(),
|
|
Vendor.Migrate()
|
|
]
|
|
},
|
|
purchaseOrders: .live(database: database),
|
|
users: .live(database: database),
|
|
vendorBranches: .live(database: database),
|
|
vendors: .live(database: database)
|
|
)
|
|
}
|
|
}
|