I have a SQLite database in my Andoid App. I have three rows, ID, DATA and DATE, where DATE is filled by SQLite by using the TIMESTAMP
as follows CREATE TABLE $TABLE ($ID INTEGER PRIMARY KEY AUTOINCREMENT, $DATE TEXT NOT NULL, $DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
.
It works fine for me. But when I update the DATA
row, the timestamp does not update with. I update the DATA
ad follows:
fun updateData(id: String, data: String): Boolean {
db.update(TABLE, ContentValues().apply {
put(DATA, data)
}, "$ID = ?", arrayOf(id))
return true
}
After update, the timestamp stays the same. How can I update the timesamp after each DATA updating?