X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FMobileLedgerDatabase.java;fp=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FMobileLedgerDatabase.java;h=0000000000000000000000000000000000000000;hp=911c2034bd13b34fab7f30c8cd74c8f3372336f1;hb=b668c61f3c8968c51033e7d82a08993b57b098e0;hpb=804f1fa43c2feb45a80cc281f39cd981953785db diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/MobileLedgerDatabase.java b/app/src/main/java/net/ktnx/mobileledger/utils/MobileLedgerDatabase.java deleted file mode 100644 index 911c2034..00000000 --- a/app/src/main/java/net/ktnx/mobileledger/utils/MobileLedgerDatabase.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright © 2021 Damyan Ivanov. - * This file is part of MoLe. - * MoLe is free software: you can distribute it and/or modify it - * under the term of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your opinion), any later version. - * - * MoLe 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 terms for details. - * - * You should have received a copy of the GNU General Public License - * along with MoLe. If not, see . - */ - -package net.ktnx.mobileledger.utils; - -import android.app.Application; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; - -import androidx.lifecycle.MutableLiveData; - -import net.ktnx.mobileledger.db.DB; - -import static net.ktnx.mobileledger.utils.Logger.debug; - -public class MobileLedgerDatabase extends SQLiteOpenHelper { - public static final MutableLiveData initComplete = new MutableLiveData<>(false); - public MobileLedgerDatabase(Application context) { - super(context, DB.DB_NAME, null, DB.REVISION); - debug("db", "creating helper instance"); - super.setWriteAheadLoggingEnabled(true); - } - - @Override - public void onCreate(SQLiteDatabase db) { - throw new IllegalStateException("Should not happen. Where's Room!?"); - } - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - throw new IllegalStateException("Should not happen. Where's Room!?"); - } - - @Override - public void onConfigure(SQLiteDatabase db) { - super.onConfigure(db); - // force a check by Room to ensure everything is OK - // TODO: remove when all DB access is via Room - DB.get() - .compileStatement("SELECT COUNT(*) FROM profiles"); - } -}