Fix possible backup crash due to foreign key constraint.

This commit is contained in:
Greyson Parrelli 2022-03-30 09:56:26 -04:00
parent 84a61b01ca
commit 3c0b87bbca

View file

@ -77,7 +77,8 @@ public class FullBackupImporter extends FullBackupBase {
"msl_message",
"reaction",
"notification_profile_schedule",
"notification_profile_allowed_members"
"notification_profile_allowed_members",
"story_sends"
};
public static void importFile(@NonNull Context context, @NonNull AttachmentSecret attachmentSecret,
@ -293,6 +294,7 @@ public class FullBackupImporter extends FullBackupBase {
String type = cursor.getString(1);
if ("table".equals(type) && !name.startsWith("sqlite_")) {
Log.i(TAG, "Dropping table: " + name);
db.execSQL("DROP TABLE IF EXISTS " + name);
}
}