Skip to content

Commit

Permalink
Update Application+build.swift
Browse files Browse the repository at this point in the history
Switch order for migrations, since Todo references on User's id, CreateUser.swift should be executed first. This is a bug when setting up the project
  • Loading branch information
ladiesman218 authored May 2, 2024
1 parent 5bed557 commit 5d447e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion todos-auth-fluent/Sources/App/Application+build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func buildApplication(_ arguments: some AppArguments) async throws -> some Appli
fluent.databases.use(.sqlite(.file("db.sqlite")), as: .sqlite)
}
// add migrations
await fluent.migrations.add(CreateTodo())
await fluent.migrations.add(CreateUser())
await fluent.migrations.add(CreateTodo())

let fluentPersist = await FluentPersistDriver(fluent: fluent)
// migrate
Expand Down

0 comments on commit 5d447e9

Please sign in to comment.