Skip to content

Commit e8d0134

Browse files
committed
postutil: CodeGood: 添加reply计数
1 parent ee4e568 commit e8d0134

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

postutil/src/main/kotlin/com/rayfantasy/icode/postutil/bean/CodeGood.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public class CodeGood extends BaseModel implements Serializable {
7777
@SerializedName("favorite")
7878
public Integer favorite;
7979

80+
@Expose
81+
@Column(name = "reply")
82+
@SerializedName("reply")
83+
public Integer reply;
84+
8085
@Override
8186
public boolean equals(Object o) {
8287
if (!(o instanceof CodeGood)) return false;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2016 Alex Zhang aka. ztc1997
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.rayfantasy.icode.postutil.database;
18+
19+
import com.raizlabs.android.dbflow.annotation.Migration;
20+
import com.raizlabs.android.dbflow.sql.SQLiteType;
21+
import com.raizlabs.android.dbflow.sql.migration.AlterTableMigration;
22+
import com.rayfantasy.icode.postutil.bean.CodeGood;
23+
24+
@Migration(version = 2, database = PostUtilDatabase.class)
25+
public class Migration2 extends AlterTableMigration<CodeGood> {
26+
public Migration2() {
27+
super(CodeGood.class);
28+
}
29+
30+
@Override
31+
public void onPreMigrate() {
32+
super.onPreMigrate();
33+
addColumn(SQLiteType.INTEGER, "reply");
34+
}
35+
}

postutil/src/main/kotlin/com/rayfantasy/icode/postutil/database/PostUtilDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
@Database(version = PostUtilDatabase.VERSION, name = PostUtilDatabase.NAME, generatedClassSeparator = "_")
2222
public class PostUtilDatabase {
2323
public static final String NAME = "icode_postutil";
24-
public static final int VERSION = 1;
24+
public static final int VERSION = 2;
2525
}

0 commit comments

Comments
 (0)