| | |
| | | package com.example.firstapp |
| | | |
| | | |
| | | import android.content.Context |
| | | import androidx.room.Database |
| | | import androidx.room.Room |
| | |
| | | import com.example.firstapp.database.dao.CodeDao |
| | | import com.example.firstapp.database.dao.KeywordDao |
| | | import com.example.firstapp.database.dao.MsgDao |
| | | import com.example.firstapp.database.dao.ReminderDao |
| | | import com.example.firstapp.database.entity.Code |
| | | import com.example.firstapp.database.entity.KeywordEntity |
| | | import com.example.firstapp.database.entity.Msg |
| | | import com.example.firstapp.database.entity.Reminder |
| | | import com.example.firstapp.utils.DATABASE_NAME |
| | | import com.example.firstapp.utils.SettingUtils |
| | | import com.example.firstapp.utils.TAG_LIST |
| | |
| | | |
| | | |
| | | @Database( |
| | | entities = [ Msg::class, Code::class, KeywordEntity::class], |
| | | // views = [LogsDetail::class], |
| | | entities = [ Msg::class, Code::class, KeywordEntity::class, Reminder::class], |
| | | version = 20, |
| | | exportSchema = false |
| | | ) |
| | |
| | | abstract fun msgDao(): MsgDao |
| | | abstract fun codeDao(): CodeDao |
| | | abstract fun keywordDao(): KeywordDao |
| | | abstract fun reminderDao(): ReminderDao |
| | | |
| | | companion object { |
| | | @Volatile |
| | |
| | | `isEnabled` INTEGER NOT NULL |
| | | ) |
| | | """) |
| | | // database.execSQL(""" |
| | | // CREATE TABLE IF NOT EXISTS `reminders` ( |
| | | // id INTEGER PRIMARY KEY AUTOINCREMENT, |
| | | // type TEXT NOT NULL, |
| | | // nickname TEXT NOT NULL, |
| | | // keywords TEXT NOT NULL, |
| | | // ); |
| | | // """) |
| | | |
| | | } |
| | | } |