1.数据库版本升级
1.1UserDBHelper.java
private static final int DB_VERSION = 2; @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { String sql = "ALTER TABLE " + TABLE_NAME + " ADD COLUMN PHONE VARCHAR;"; db.execSQL(sql); sql = "ALTER TABLE " + TABLE_NAME + " ADD COLUMN PASSWORD VARCHAR;"; db.execSQL(sql); }
1.2效果:
标签:10,execSQL,int,31,db,2022,sql,TABLE,ALTER From: https://www.cnblogs.com/pingfanliliang/p/16842973.html