From d90ea77f08d047ffd063ab9e977de8fd7f52c97d Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 6 Jun 2019 23:26:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/data/entities/Chapter.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/data/entities/Chapter.kt b/app/src/main/java/io/legado/app/data/entities/Chapter.kt index 724ae6258..3513143d3 100644 --- a/app/src/main/java/io/legado/app/data/entities/Chapter.kt +++ b/app/src/main/java/io/legado/app/data/entities/Chapter.kt @@ -10,12 +10,13 @@ import kotlinx.android.parcel.Parcelize @Parcelize @Entity(tableName = "chapters", + primaryKeys = ["url", "bookUrl"], indices = [(Index(value = ["url"], unique = true)), (Index(value = ["bookUrl", "index"], unique = true))], foreignKeys = [(ForeignKey(entity = Book::class, parentColumns = ["descUrl"], childColumns = ["bookUrl"], onDelete = ForeignKey.CASCADE))]) // 删除书籍时自动删除章节 -data class Chapter(@PrimaryKey +data class Chapter( var url: String = "", // 章节地址 var title: String = "", // 章节标题 var bookUrl: String = "", // 书籍地址