2017-05-23 17:28:12 +02:00
|
|
|
//
|
2018-01-30 17:27:44 +01:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-05-23 17:28:12 +02:00
|
|
|
//
|
2016-09-28 18:21:14 +02:00
|
|
|
|
2020-11-23 00:24:40 +01:00
|
|
|
#import <SessionUtilitiesKit/TSYapDatabaseObject.h>
|
2016-09-28 18:21:14 +02:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2022-03-24 00:03:51 +01:00
|
|
|
typedef void (^OWSDatabaseMigrationCompletion)(BOOL success, BOOL requiresConfigurationSync);
|
2018-01-30 17:27:44 +01:00
|
|
|
|
2018-03-05 15:30:58 +01:00
|
|
|
@class OWSPrimaryStorage;
|
2016-09-28 18:21:14 +02:00
|
|
|
|
|
|
|
@interface OWSDatabaseMigration : TSYapDatabaseObject
|
|
|
|
|
2018-03-05 15:30:58 +01:00
|
|
|
@property (nonatomic, readonly) OWSPrimaryStorage *primaryStorage;
|
2016-09-28 18:21:14 +02:00
|
|
|
|
2017-05-23 17:28:12 +02:00
|
|
|
// Prefer nonblocking (async) migrations by overriding `runUpWithTransaction:` in a subclass.
|
|
|
|
// Blocking migrations running too long will crash the app, effectively bricking install
|
|
|
|
// because the user will never get past it.
|
|
|
|
// If you must write a launch-blocking migration, override runUp.
|
2018-01-30 17:27:44 +01:00
|
|
|
- (void)runUpWithCompletion:(OWSDatabaseMigrationCompletion)completion;
|
2016-09-28 18:21:14 +02:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|