mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 22:46:46 +00:00
fix increased twonly safe backup
This commit is contained in:
parent
7ac10d8326
commit
aee31f5b40
3 changed files with 14 additions and 0 deletions
|
|
@ -65,6 +65,7 @@ void main() async {
|
||||||
twonlyDB = TwonlyDB();
|
twonlyDB = TwonlyDB();
|
||||||
|
|
||||||
await twonlyDB.messagesDao.purgeMessageTable();
|
await twonlyDB.messagesDao.purgeMessageTable();
|
||||||
|
await twonlyDB.receiptsDao.purgeReceivedReceipts();
|
||||||
unawaited(MediaFileService.purgeTempFolder());
|
unawaited(MediaFileService.purgeTempFolder());
|
||||||
|
|
||||||
await initFileDownloader();
|
await initFileDownloader();
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,18 @@ class ReceiptsDao extends DatabaseAccessor<TwonlyDB> with _$ReceiptsDaoMixin {
|
||||||
.go();
|
.go();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> purgeReceivedReceipts() async {
|
||||||
|
await (delete(receivedReceipts)
|
||||||
|
..where(
|
||||||
|
(t) => (t.createdAt.isSmallerThanValue(
|
||||||
|
clock.now().subtract(
|
||||||
|
const Duration(days: 25),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
))
|
||||||
|
.go();
|
||||||
|
}
|
||||||
|
|
||||||
Future<Receipt?> insertReceipt(ReceiptsCompanion entry) async {
|
Future<Receipt?> insertReceipt(ReceiptsCompanion entry) async {
|
||||||
try {
|
try {
|
||||||
var insertEntry = entry;
|
var insertEntry = entry;
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ class TwonlyDB extends _$TwonlyDB {
|
||||||
))
|
))
|
||||||
.go();
|
.go();
|
||||||
await delete(receipts).go();
|
await delete(receipts).go();
|
||||||
|
await delete(receivedReceipts).go();
|
||||||
await update(contacts).write(
|
await update(contacts).write(
|
||||||
const ContactsCompanion(
|
const ContactsCompanion(
|
||||||
avatarSvgCompressed: Value(null),
|
avatarSvgCompressed: Value(null),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue