Browse Source

更新数据库

master
白凤吉 4 months ago
parent
commit
d9a578289f
  1. 3
      app/src/main/java/com/iflytop/profilometer/api/sync/SyncRoutes.kt
  2. 37
      app/src/main/java/com/iflytop/profilometer/core/db/helper/MyDatabaseHelper.java

3
app/src/main/java/com/iflytop/profilometer/api/sync/SyncRoutes.kt

@ -71,9 +71,6 @@ fun Routing.syncRoutes(context: Context) {
call.respondText(jsonResponse, ContentType.Application.Json)
}
/**
*
*/

37
app/src/main/java/com/iflytop/profilometer/core/db/helper/MyDatabaseHelper.java

@ -7,7 +7,7 @@ import android.database.sqlite.SQLiteOpenHelper;
public class MyDatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "app.db";
private static final int DATABASE_VERSION = 3; // 升级版本号
private static final int DATABASE_VERSION = 4; // 升级版本号
// 表名
public static final String TABLE_APP_USER = "app_user";
@ -39,9 +39,20 @@ public class MyDatabaseHelper extends SQLiteOpenHelper {
+ "create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+ "update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+ "uuid TEXT, "
+ "operator_name TEXT, "
+ "track_shape_code TEXT, "
+ "verification_method_code TEXT, "
+ "operator TEXT, "
+ "tlj_code TEXT, "
+ "gwd_code TEXT, "
+ "xm_code TEXT, "
+ "station_code TEXT, "
+ "data_type TEXT, "
+ "data_source TEXT, "
+ "rail_size TEXT, "
+ "line_classify TEXT, "
+ "batch TEXT, "
+ "xb_code TEXT, "
+ "mileage TEXT, "
+ "unit_type TEXT, "
+ "extra_desc TEXT, "
+ "name TEXT NOT NULL, "
+ "line_name TEXT, "
+ "location TEXT, "
@ -49,6 +60,7 @@ public class MyDatabaseHelper extends SQLiteOpenHelper {
+ "sync_status TEXT"
+ ");";
// 测量点集表建表语句
private static final String CREATE_TABLE_PROFILE_RECORD_POINT_SET =
"CREATE TABLE IF NOT EXISTS " + TABLE_PROFILE_RECORD_POINT_SET + " ("
@ -89,9 +101,20 @@ public class MyDatabaseHelper extends SQLiteOpenHelper {
+ "create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+ "update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "
+ "uuid TEXT, "
+ "operator_name TEXT, "
+ "track_shape_code TEXT, "
+ "verification_method_code TEXT, "
+ "operator TEXT, "
+ "tlj_code TEXT, "
+ "gwd_code TEXT, "
+ "xm_code TEXT, "
+ "station_code TEXT, "
+ "data_type TEXT, "
+ "data_source TEXT, "
+ "rail_size TEXT, "
+ "line_classify TEXT, "
+ "batch TEXT, "
+ "xb_code TEXT, "
+ "mileage TEXT, "
+ "unit_type TEXT, "
+ "extra_desc TEXT, "
+ "name TEXT NOT NULL, "
+ "line_name TEXT, "
+ "location TEXT, "

Loading…
Cancel
Save