Skip to content

Commit

Permalink
fix: db error with behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel committed Feb 26, 2024
1 parent 4b93243 commit a880c1f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/db/lib/src/behavior.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ Query behaviorStatesWithBehaviorQuery(Behavior behavior) => Query(
/// Query to insert or update a behavior state.
Query upsertBehaviorStateQuery(BehaviorState state) => Query(
'''
INSERT INTO behavior_ (ship_symbol, json)
VALUES (@ship_symbol, @json)
ON CONFLICT (ship_symbol) DO UPDATE SET json = @json
INSERT INTO behavior_ (ship_symbol, behavior, json)
VALUES (@ship_symbol, @behavior, @json)
ON CONFLICT (ship_symbol) DO UPDATE SET
behavior = @behavior,
json = @json
''',
parameters: {
'ship_symbol': state.shipSymbol.toJson(),
Expand Down

0 comments on commit a880c1f

Please sign in to comment.