Skip to content

Commit

Permalink
add database entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Peketr committed Mar 18, 2024
1 parent bcf9120 commit 745ef6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ package org.isoron.uhabits.core

const val DATABASE_FILENAME = "uhabits.db"

const val DATABASE_VERSION = 25
const val DATABASE_VERSION = 26
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class HabitRecord {
@field:Column
var uuid: String? = null

@field:Column
var increment: Double? = 0.0

fun copyFrom(model: Habit) {
id = model.id
name = model.name
Expand All @@ -114,6 +117,7 @@ class HabitRecord {
reminderMin = reminder!!.minute
reminderDays = reminder.days.toInteger()
}
increment = model.increment
}

fun copyTo(habit: Habit) {
Expand All @@ -137,5 +141,6 @@ class HabitRecord {
WeekdayList(reminderDays!!)
)
}
habit.increment = increment!!
}
}
1 change: 1 addition & 0 deletions uhabits-core/src/jvmMain/resources/migrations/26.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table Habits add column increment;

0 comments on commit 745ef6a

Please sign in to comment.