2022-03-31 02:47:09 +02:00
|
|
|
import Foundation
|
2023-07-13 09:57:08 +02:00
|
|
|
import GRDB
|
2022-03-31 02:47:09 +02:00
|
|
|
import SessionUtilitiesKit
|
2020-11-06 01:41:01 +01:00
|
|
|
|
2023-07-13 09:57:08 +02:00
|
|
|
public enum SNMessagingKit: MigratableTarget { // Just to make the external API nice
|
|
|
|
public static func migrations(_ db: Database) -> TargetMigrations {
|
2022-03-31 02:47:09 +02:00
|
|
|
return TargetMigrations(
|
|
|
|
identifier: .messagingKit,
|
|
|
|
migrations: [
|
|
|
|
[
|
2022-04-21 08:42:35 +02:00
|
|
|
_001_InitialSetupMigration.self,
|
|
|
|
_002_SetupStandardJobs.self
|
2022-03-31 02:47:09 +02:00
|
|
|
],
|
|
|
|
[
|
2022-04-21 08:42:35 +02:00
|
|
|
_003_YDBToGRDBMigration.self
|
2022-07-25 07:39:56 +02:00
|
|
|
],
|
2022-08-01 08:53:05 +02:00
|
|
|
[
|
|
|
|
_004_RemoveLegacyYDB.self
|
2022-08-02 01:35:55 +02:00
|
|
|
],
|
2022-07-25 07:39:56 +02:00
|
|
|
[
|
2022-08-16 05:56:40 +02:00
|
|
|
_005_FixDeletedMessageReadState.self,
|
2022-08-19 08:58:47 +02:00
|
|
|
_006_FixHiddenModAdminSupport.self,
|
2022-08-23 04:25:23 +02:00
|
|
|
_007_HomeQueryOptimisationIndexes.self
|
|
|
|
],
|
|
|
|
[
|
2022-09-07 09:37:01 +02:00
|
|
|
_008_EmojiReacts.self,
|
2022-09-26 03:16:47 +02:00
|
|
|
_009_OpenGroupPermission.self,
|
2023-02-01 08:12:36 +01:00
|
|
|
_010_AddThreadIdToFTS.self
|
|
|
|
], // Add job priorities
|
|
|
|
[
|
2023-03-14 00:44:02 +01:00
|
|
|
_011_AddPendingReadReceipts.self,
|
2023-03-15 05:00:01 +01:00
|
|
|
_012_AddFTSIfNeeded.self,
|
2023-03-15 05:27:01 +01:00
|
|
|
_013_SessionUtilChanges.self,
|
2023-08-11 10:29:33 +02:00
|
|
|
_014_GenerateInitialUserConfigDumps.self,
|
2023-09-22 06:49:39 +02:00
|
|
|
_015_BlockCommunityMessageRequests.self,
|
|
|
|
_016_MakeBrokenProfileTimestampsNullable.self
|
2023-08-03 01:09:33 +02:00
|
|
|
]
|
2022-03-31 02:47:09 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-06-01 09:41:20 +02:00
|
|
|
public static func configure() {
|
2022-04-21 08:42:35 +02:00
|
|
|
// Configure the job executors
|
2023-04-05 08:49:38 +02:00
|
|
|
JobRunner.setExecutor(DisappearingMessagesJob.self, for: .disappearingMessages)
|
|
|
|
JobRunner.setExecutor(FailedMessageSendsJob.self, for: .failedMessageSends)
|
|
|
|
JobRunner.setExecutor(FailedAttachmentDownloadsJob.self, for: .failedAttachmentDownloads)
|
|
|
|
JobRunner.setExecutor(UpdateProfilePictureJob.self, for: .updateProfilePicture)
|
|
|
|
JobRunner.setExecutor(RetrieveDefaultOpenGroupRoomsJob.self, for: .retrieveDefaultOpenGroupRooms)
|
|
|
|
JobRunner.setExecutor(GarbageCollectionJob.self, for: .garbageCollection)
|
|
|
|
JobRunner.setExecutor(MessageSendJob.self, for: .messageSend)
|
|
|
|
JobRunner.setExecutor(MessageReceiveJob.self, for: .messageReceive)
|
|
|
|
JobRunner.setExecutor(NotifyPushServerJob.self, for: .notifyPushServer)
|
|
|
|
JobRunner.setExecutor(SendReadReceiptsJob.self, for: .sendReadReceipts)
|
|
|
|
JobRunner.setExecutor(AttachmentUploadJob.self, for: .attachmentUpload)
|
2023-04-05 08:52:31 +02:00
|
|
|
JobRunner.setExecutor(GroupLeavingJob.self, for: .groupLeaving)
|
2023-07-18 02:02:51 +02:00
|
|
|
JobRunner.setExecutor(AttachmentDownloadJob.self, for: .attachmentDownload)
|
|
|
|
JobRunner.setExecutor(ConfigurationSyncJob.self, for: .configurationSync)
|
|
|
|
JobRunner.setExecutor(ConfigMessageReceiveJob.self, for: .configMessageReceive)
|
2020-11-06 01:41:01 +01:00
|
|
|
}
|
|
|
|
}
|