From b6d21c1b4a280578185219d017f5e2e00b2d178b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 22 Feb 2022 16:48:44 +0100 Subject: [PATCH] lets add some advanced values to Tasks too, wont be used initially --- .../calendar/pro/databases/EventsDatabase.kt | 2 +- .../com/simplemobiletools/calendar/pro/models/Task.kt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/databases/EventsDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/databases/EventsDatabase.kt index 0f29d761c..dd7cf1e41 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/databases/EventsDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/databases/EventsDatabase.kt @@ -112,7 +112,7 @@ abstract class EventsDatabase : RoomDatabase() { private val MIGRATION_5_6 = object : Migration(5, 6) { override fun migrate(database: SupportSQLiteDatabase) { database.apply { - execSQL("CREATE TABLE IF NOT EXISTS `tasks` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `start_ts` INTEGER NOT NULL, `title` TEXT NOT NULL, `description` TEXT NOT NULL, `import_id` TEXT NOT NULL, `time_zone` TEXT NOT NULL, `flags` INTEGER NOT NULL, `event_type` INTEGER NOT NULL, `last_updated` INTEGER NOT NULL, `source` TEXT NOT NULL, `color` INTEGER NOT NULL)") + execSQL("CREATE TABLE IF NOT EXISTS `tasks` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `start_ts` INTEGER NOT NULL, `title` TEXT NOT NULL, `description` TEXT NOT NULL, `reminder_1_minutes` INTEGER NOT NULL, `reminder_2_minutes` INTEGER NOT NULL, `reminder_3_minutes` INTEGER NOT NULL, `repeat_interval` INTEGER NOT NULL, `repeat_rule` INTEGER NOT NULL, `repeat_limit` INTEGER NOT NULL, `repetition_exceptions` TEXT NOT NULL, `import_id` TEXT NOT NULL, `time_zone` TEXT NOT NULL, `flags` INTEGER NOT NULL, `event_type` INTEGER NOT NULL, `last_updated` INTEGER NOT NULL, `source` TEXT NOT NULL, `color` INTEGER NOT NULL)") execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_tasks_id` ON `tasks` (`id`)") } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Task.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Task.kt index 6cf96f265..293bead0f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Task.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/models/Task.kt @@ -15,6 +15,13 @@ data class Task( @ColumnInfo(name = "start_ts") var startTS: Long = 0L, @ColumnInfo(name = "title") var title: String = "", @ColumnInfo(name = "description") var description: String = "", + @ColumnInfo(name = "reminder_1_minutes") var reminder1Minutes: Int = REMINDER_OFF, + @ColumnInfo(name = "reminder_2_minutes") var reminder2Minutes: Int = REMINDER_OFF, + @ColumnInfo(name = "reminder_3_minutes") var reminder3Minutes: Int = REMINDER_OFF, + @ColumnInfo(name = "repeat_interval") var repeatInterval: Int = 0, + @ColumnInfo(name = "repeat_rule") var repeatRule: Int = 0, + @ColumnInfo(name = "repeat_limit") var repeatLimit: Long = 0L, + @ColumnInfo(name = "repetition_exceptions") var repetitionExceptions: ArrayList = ArrayList(), @ColumnInfo(name = "import_id") var importId: String = "", @ColumnInfo(name = "time_zone") var timeZone: String = "", @ColumnInfo(name = "flags") var flags: Int = 0,