session-android/app/src/main/java/org/thoughtcrime/securesms/database/DatabaseFactory.java

34 lines
1.2 KiB
Java
Raw Normal View History

/*
* Copyright (C) 2018 Open Whisper Systems
2012-10-01 04:56:29 +02:00
*
2011-12-20 19:20:44 +01:00
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
2012-10-01 04:56:29 +02:00
*
2011-12-20 19:20:44 +01:00
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.thoughtcrime.securesms.database;
import android.content.Context;
2021-07-19 05:55:11 +02:00
import net.sqlcipher.database.SQLiteDatabase;
2021-07-19 05:55:11 +02:00
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
import org.thoughtcrime.securesms.dependencies.DatabaseComponent;
2011-12-20 19:20:44 +01:00
public class DatabaseFactory {
public static void upgradeRestored(Context context, SQLiteDatabase database){
SQLCipherOpenHelper databaseHelper = DatabaseComponent.get(context).openHelper();
databaseHelper.onUpgrade(database, database.getVersion(), -1);
databaseHelper.markCurrent(database);
}
2011-12-20 19:20:44 +01:00
}