feat: Adds script to generate database seeded values and removes old mock storage.
This commit is contained in:
@@ -30,7 +30,8 @@ public func configure(_ app: Application) async throws {
|
||||
|
||||
switch app.environment {
|
||||
case .production, .development:
|
||||
app.databases.use(DatabaseConfigurationFactory.sqlite(.file("db.sqlite")), as: .sqlite)
|
||||
let dbFileName = Environment.get("SQLITE_FILENAME") ?? "db.sqlite"
|
||||
app.databases.use(DatabaseConfigurationFactory.sqlite(.file(dbFileName)), as: .sqlite)
|
||||
default:
|
||||
app.databases.use(DatabaseConfigurationFactory.sqlite(.memory), as: .sqlite)
|
||||
}
|
||||
@@ -48,5 +49,6 @@ public func configure(_ app: Application) async throws {
|
||||
|
||||
if app.environment != .production {
|
||||
try await app.autoMigrate()
|
||||
app.asyncCommands.use(SeedCommand(), as: "seed")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user