diff --git a/db/src/androidTest/java/com/readrops/db/dao/NewFeedDaoTest.kt b/db/src/androidTest/java/com/readrops/db/dao/FeedDaoTest.kt similarity index 99% rename from db/src/androidTest/java/com/readrops/db/dao/NewFeedDaoTest.kt rename to db/src/androidTest/java/com/readrops/db/dao/FeedDaoTest.kt index 33b2483a..b10fe6d6 100644 --- a/db/src/androidTest/java/com/readrops/db/dao/NewFeedDaoTest.kt +++ b/db/src/androidTest/java/com/readrops/db/dao/FeedDaoTest.kt @@ -18,7 +18,7 @@ import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) -class NewFeedDaoTest { +class FeedDaoTest { private lateinit var database: Database private lateinit var account: Account diff --git a/db/src/androidTest/java/com/readrops/db/dao/NewFolderDaoTest.kt b/db/src/androidTest/java/com/readrops/db/dao/FolderDaoTest.kt similarity index 98% rename from db/src/androidTest/java/com/readrops/db/dao/NewFolderDaoTest.kt rename to db/src/androidTest/java/com/readrops/db/dao/FolderDaoTest.kt index 9836708c..c31e2f64 100644 --- a/db/src/androidTest/java/com/readrops/db/dao/NewFolderDaoTest.kt +++ b/db/src/androidTest/java/com/readrops/db/dao/FolderDaoTest.kt @@ -18,7 +18,7 @@ import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) -class NewFolderDaoTest { +class FolderDaoTest { private lateinit var database: Database private lateinit var account: Account diff --git a/db/src/main/java/com/readrops/db/Database.kt b/db/src/main/java/com/readrops/db/Database.kt index 66231e57..f1841871 100644 --- a/db/src/main/java/com/readrops/db/Database.kt +++ b/db/src/main/java/com/readrops/db/Database.kt @@ -6,12 +6,12 @@ import androidx.room.RoomDatabase import androidx.room.TypeConverters import androidx.room.migration.Migration import androidx.sqlite.db.SupportSQLiteDatabase -import com.readrops.db.dao.newdao.NewAccountDao -import com.readrops.db.dao.newdao.NewFeedDao -import com.readrops.db.dao.newdao.NewFolderDao -import com.readrops.db.dao.newdao.NewItemDao -import com.readrops.db.dao.newdao.NewItemStateChangeDao -import com.readrops.db.dao.newdao.NewItemStateDao +import com.readrops.db.dao.AccountDao +import com.readrops.db.dao.FeedDao +import com.readrops.db.dao.FolderDao +import com.readrops.db.dao.ItemDao +import com.readrops.db.dao.ItemStateChangeDao +import com.readrops.db.dao.ItemStateDao import com.readrops.db.entities.Feed import com.readrops.db.entities.Folder import com.readrops.db.entities.Item @@ -30,17 +30,17 @@ import com.readrops.db.entities.account.Account abstract class Database : RoomDatabase() { // new dao - abstract fun newFeedDao(): NewFeedDao + abstract fun newFeedDao(): FeedDao - abstract fun newItemDao(): NewItemDao + abstract fun newItemDao(): ItemDao - abstract fun newAccountDao(): NewAccountDao + abstract fun newAccountDao(): AccountDao - abstract fun newFolderDao(): NewFolderDao + abstract fun newFolderDao(): FolderDao - abstract fun newItemStateDao(): NewItemStateDao + abstract fun newItemStateDao(): ItemStateDao - abstract fun newItemStateChangeDao(): NewItemStateChangeDao + abstract fun newItemStateChangeDao(): ItemStateChangeDao } object MigrationFrom1To2 : Migration(1, 2) { diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewAccountDao.kt b/db/src/main/java/com/readrops/db/dao/AccountDao.kt similarity index 92% rename from db/src/main/java/com/readrops/db/dao/newdao/NewAccountDao.kt rename to db/src/main/java/com/readrops/db/dao/AccountDao.kt index 00b8611e..4d9ea14c 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewAccountDao.kt +++ b/db/src/main/java/com/readrops/db/dao/AccountDao.kt @@ -1,4 +1,4 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Dao import androidx.room.Query @@ -6,7 +6,7 @@ import com.readrops.db.entities.account.Account import kotlinx.coroutines.flow.Flow @Dao -interface NewAccountDao : NewBaseDao { +interface AccountDao : BaseDao { @Query("Select * From Account") fun selectAllAccounts(): Flow> diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewBaseDao.kt b/db/src/main/java/com/readrops/db/dao/BaseDao.kt similarity index 86% rename from db/src/main/java/com/readrops/db/dao/newdao/NewBaseDao.kt rename to db/src/main/java/com/readrops/db/dao/BaseDao.kt index 63528a00..5f9ac53a 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewBaseDao.kt +++ b/db/src/main/java/com/readrops/db/dao/BaseDao.kt @@ -1,10 +1,10 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Delete import androidx.room.Insert import androidx.room.Update -interface NewBaseDao { +interface BaseDao { @Insert suspend fun insert(entity: T): Long diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewFeedDao.kt b/db/src/main/java/com/readrops/db/dao/FeedDao.kt similarity index 98% rename from db/src/main/java/com/readrops/db/dao/newdao/NewFeedDao.kt rename to db/src/main/java/com/readrops/db/dao/FeedDao.kt index eff23266..4f8c62ac 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewFeedDao.kt +++ b/db/src/main/java/com/readrops/db/dao/FeedDao.kt @@ -1,4 +1,4 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Dao import androidx.room.Query @@ -13,7 +13,7 @@ import com.readrops.db.pojo.FeedWithFolder2 import kotlinx.coroutines.flow.Flow @Dao -abstract class NewFeedDao : NewBaseDao { +abstract class FeedDao : BaseDao { @Query("Select * From Feed Where id = :feedId") abstract suspend fun selectFeed(feedId: Int): Feed diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewFolderDao.kt b/db/src/main/java/com/readrops/db/dao/FolderDao.kt similarity index 97% rename from db/src/main/java/com/readrops/db/dao/newdao/NewFolderDao.kt rename to db/src/main/java/com/readrops/db/dao/FolderDao.kt index 276b5a1d..57681bd6 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewFolderDao.kt +++ b/db/src/main/java/com/readrops/db/dao/FolderDao.kt @@ -1,4 +1,4 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Dao import androidx.room.Query @@ -9,7 +9,7 @@ import com.readrops.db.pojo.FolderWithFeed import kotlinx.coroutines.flow.Flow @Dao -interface NewFolderDao : NewBaseDao { +interface FolderDao : BaseDao { @Query(""" Select Feed.id As feedId, Feed.name As feedName, Feed.icon_url As feedIcon, Feed.url As feedUrl, diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewItemDao.kt b/db/src/main/java/com/readrops/db/dao/ItemDao.kt similarity index 97% rename from db/src/main/java/com/readrops/db/dao/newdao/NewItemDao.kt rename to db/src/main/java/com/readrops/db/dao/ItemDao.kt index aea8a9fd..03cd438e 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewItemDao.kt +++ b/db/src/main/java/com/readrops/db/dao/ItemDao.kt @@ -1,4 +1,4 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.paging.PagingSource import androidx.room.Dao @@ -14,7 +14,7 @@ import com.readrops.db.pojo.ItemWithFeed import kotlinx.coroutines.flow.Flow @Dao -abstract class NewItemDao : NewBaseDao { +abstract class ItemDao : BaseDao { @RawQuery(observedEntities = [Item::class, Feed::class, Folder::class, ItemState::class]) abstract fun selectAll(query: SupportSQLiteQuery): PagingSource diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewItemStateChangeDao.kt b/db/src/main/java/com/readrops/db/dao/ItemStateChangeDao.kt similarity index 98% rename from db/src/main/java/com/readrops/db/dao/newdao/NewItemStateChangeDao.kt rename to db/src/main/java/com/readrops/db/dao/ItemStateChangeDao.kt index 96fca328..aef54766 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewItemStateChangeDao.kt +++ b/db/src/main/java/com/readrops/db/dao/ItemStateChangeDao.kt @@ -1,4 +1,4 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Dao import androidx.room.Query @@ -7,7 +7,7 @@ import com.readrops.db.entities.ItemStateChange import com.readrops.db.pojo.ItemReadStarState @Dao -interface NewItemStateChangeDao: NewBaseDao { +interface ItemStateChangeDao: BaseDao { @Query("Delete From ItemStateChange Where account_id = :accountId") suspend fun resetStateChanges(accountId: Int) diff --git a/db/src/main/java/com/readrops/db/dao/newdao/NewItemStateDao.kt b/db/src/main/java/com/readrops/db/dao/ItemStateDao.kt similarity index 98% rename from db/src/main/java/com/readrops/db/dao/newdao/NewItemStateDao.kt rename to db/src/main/java/com/readrops/db/dao/ItemStateDao.kt index fbef8c17..585fd323 100644 --- a/db/src/main/java/com/readrops/db/dao/newdao/NewItemStateDao.kt +++ b/db/src/main/java/com/readrops/db/dao/ItemStateDao.kt @@ -1,11 +1,11 @@ -package com.readrops.db.dao.newdao +package com.readrops.db.dao import androidx.room.Dao import androidx.room.Query import com.readrops.db.entities.ItemState @Dao -interface NewItemStateDao : NewBaseDao { +interface ItemStateDao : BaseDao { @Query("Delete From ItemState Where account_id = :accountId") suspend fun deleteItemStates(accountId: Int)