Vapor 3 软件包,用于预填充任何数据库的香料相关数据。
将其导入到你的项目
let package = Package(name: "TestVaporSpices",
dependencies: [
//VaporSpices
.package(url: "https://github.com/mihaelamj/VaporSpices", from: "0.1.0")
],
targets: [
.target(name: "App", dependencies: ["FluentSQLite", "FluentMySQL", "FluentPostgreSQL", "VaporSpices"]),
]
)
用法(用于 MySQL)
import VaporSpices
migrations.addVaporSpices(for: .mysql)
用法(用于 PostgreSQL)
import VaporSpices
migrations.addVaporSpices(for: .psql)
用法(用于 SQLite)
import VaporSpices
migrations.addVaporSpices(for: .sqlite)