only migrate if not yet opened
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2026-05-17 20:30:15 +02:00
parent 5bcb3b3efe
commit 236d94622c

View file

@ -158,13 +158,18 @@ Future<void> runMigrations() async {
final now = clock.now(); final now = clock.now();
for (final messageId in messageIds.first.split(',')) { for (final messageId in messageIds.first.split(',')) {
await (twonlyDB.update( await (twonlyDB.update(
twonlyDB.messages, twonlyDB.messages,
)..where((tbl) => tbl.messageId.equals(messageId))).write( )..where(
MessagesCompanion( (tbl) =>
openedAt: Value(now), tbl.messageId.equals(messageId) &
openedByAll: Value(now), (tbl.openedByAll.isNull() | tbl.openedAt.isNull()),
), ))
); .write(
MessagesCompanion(
openedAt: Value(now),
openedByAll: Value(now),
),
);
} }
} }
} }