mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 05:42:11 +00:00
only migrate if not yet opened
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
5bcb3b3efe
commit
236d94622c
1 changed files with 12 additions and 7 deletions
|
|
@ -158,13 +158,18 @@ Future<void> runMigrations() async {
|
|||
final now = clock.now();
|
||||
for (final messageId in messageIds.first.split(',')) {
|
||||
await (twonlyDB.update(
|
||||
twonlyDB.messages,
|
||||
)..where((tbl) => tbl.messageId.equals(messageId))).write(
|
||||
MessagesCompanion(
|
||||
openedAt: Value(now),
|
||||
openedByAll: Value(now),
|
||||
),
|
||||
);
|
||||
twonlyDB.messages,
|
||||
)..where(
|
||||
(tbl) =>
|
||||
tbl.messageId.equals(messageId) &
|
||||
(tbl.openedByAll.isNull() | tbl.openedAt.isNull()),
|
||||
))
|
||||
.write(
|
||||
MessagesCompanion(
|
||||
openedAt: Value(now),
|
||||
openedByAll: Value(now),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue