Skip to content

Commit 1403bad

Browse files
authored
Merge pull request #369 from OpenHub-Store/fix-room-migration
2 parents fe68d44 + 807a45b commit 1403bad

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ private fun LiquidGlassTabItem(
360360
)
361361

362362
val horizontalPadding by animateDpAsState(
363-
targetValue = if (isSelected) 20.dp else 14.dp,
363+
targetValue = if (isSelected) 14.dp else 10.dp,
364364
animationSpec =
365365
spring(
366366
dampingRatio = Spring.DampingRatioNoBouncy,

core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/initDatabase.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import zed.rainxch.core.data.local.db.migrations.MIGRATION_2_3
88
import zed.rainxch.core.data.local.db.migrations.MIGRATION_3_4
99
import zed.rainxch.core.data.local.db.migrations.MIGRATION_4_5
1010
import zed.rainxch.core.data.local.db.migrations.MIGRATION_5_6
11+
import zed.rainxch.core.data.local.db.migrations.MIGRATION_6_7
1112
import zed.rainxch.core.data.local.db.migrations.MIGRATION_7_8
1213

1314
fun initDatabase(context: Context): AppDatabase {
@@ -24,6 +25,7 @@ fun initDatabase(context: Context): AppDatabase {
2425
MIGRATION_3_4,
2526
MIGRATION_4_5,
2627
MIGRATION_5_6,
28+
MIGRATION_6_7,
2729
MIGRATION_7_8,
2830
).build()
2931
}

core/data/src/androidMain/kotlin/zed/rainxch/core/data/local/db/migrations/MIGRATION_5_6.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ val MIGRATION_5_6 =
1010
"""
1111
CREATE TABLE IF NOT EXISTS seen_repos (
1212
repoId INTEGER NOT NULL PRIMARY KEY,
13+
repoName TEXT NOT NULL DEFAULT '',
14+
repoOwner TEXT NOT NULL DEFAULT '',
15+
repoOwnerAvatarUrl TEXT NOT NULL DEFAULT '',
16+
repoDescription TEXT,
17+
primaryLanguage TEXT,
18+
repoUrl TEXT NOT NULL DEFAULT '',
1319
seenAt INTEGER NOT NULL
1420
)
1521
""".trimIndent(),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package zed.rainxch.core.data.local.db.migrations
2+
3+
import androidx.room.migration.Migration
4+
import androidx.sqlite.db.SupportSQLiteDatabase
5+
6+
val MIGRATION_6_7 =
7+
object : Migration(6, 7) {
8+
override fun migrate(db: SupportSQLiteDatabase) {
9+
db.execSQL(
10+
"""
11+
CREATE TABLE IF NOT EXISTS search_history (
12+
query TEXT NOT NULL PRIMARY KEY,
13+
searchedAt INTEGER NOT NULL
14+
)
15+
""".trimIndent(),
16+
)
17+
}
18+
}

0 commit comments

Comments
 (0)