Skip to content

Commit

Permalink
Fix DB
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Dec 20, 2024
1 parent 898cf09 commit ca5ce48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/koalasat/pokey/database/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ val MIGRATION_8_9 =
val MIGRATION_9_10 =
object : Migration(9, 10) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE notification ADD COLUMN title TEXT DEFAULT '';")
db.execSQL("ALTER TABLE notification ADD COLUMN text TEXT DEFAULT '';")
db.execSQL("ALTER TABLE notification ADD COLUMN accountKexPub TEXT DEFAULT '';")
db.execSQL("ALTER TABLE notification ADD COLUMN avatarUrl TEXT DEFAULT '';")
db.execSQL("ALTER TABLE notification ADD COLUMN nip32 TEXT NOT NULL DEFAULT '';")
db.execSQL("ALTER TABLE notification ADD COLUMN title TEXT;")
db.execSQL("ALTER TABLE notification ADD COLUMN text TEXT;")
db.execSQL("ALTER TABLE notification ADD COLUMN avatarUrl TEXT;")
db.execSQL("ALTER TABLE notification ADD COLUMN accountKexPub NOT NULL TEXT;")
db.execSQL("ALTER TABLE notification ADD COLUMN nip32 TEXT NOT NULL;")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ApplicationDao {
@Query("SELECT EXISTS (SELECT 1 FROM notification WHERE eventId = :eventId)")
fun existsNotification(eventId: String): Int

@Query("SELECT * FROM notification WHERE title != '' ORDER BY time DESC")
@Query("SELECT * FROM notification WHERE title != NULL ORDER BY time DESC")
fun getNotifications(): List<NotificationEntity>

@Insert(onConflict = OnConflictStrategy.REPLACE)
Expand Down

0 comments on commit ca5ce48

Please sign in to comment.