Fix database migration of field forceOverwrite to NameCollisionPolicy

Signed-off-by: Alice Gaudon <alice@gaudon.pro>
This commit is contained in:
Alice Gaudon 2019-12-09 13:11:45 +01:00 committed by tobiasKaminsky
parent 52d089b18a
commit 91ef307e7a
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 6 additions and 3 deletions

View file

@ -1053,10 +1053,13 @@ public class FileUploader extends Service
}
/**
* Ordinal of enumerated constants is important for old data compatibility.
*/
public enum NameCollisionPolicy {
RENAME, // Ordinal corresponds to old forceOverwrite = false (0 in database)
OVERWRITE, // Ordinal corresponds to old forceOverwrite = true (1 in database)
CANCEL,
RENAME,
OVERWRITE,
ASK_USER;
public static final NameCollisionPolicy DEFAULT = RENAME;

View file

@ -2147,7 +2147,7 @@ public class FileContentProvider extends ContentProvider {
ProviderTableMeta.UPLOADS_STATUS + ", " +
ProviderTableMeta.UPLOADS_LOCAL_BEHAVIOUR + ", " +
ProviderTableMeta.UPLOADS_UPLOAD_TIME + ", " +
"force_overwrite" + ", " +
"force_overwrite" + ", " + // See FileUploader.NameCollisionPolicy
ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER + ", " +
ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP + ", " +
ProviderTableMeta.UPLOADS_LAST_RESULT + ", " +