new DbManager.DaoConfig().setDbName("test.db").setDbVersion(6).setAllowTransaction(true).setDbDir(new File(FileUtils.DATAPATH)) .setTableCreateListener(new TableCreateListener() { @Override public void onTableCreate(DbManager arg0,TableEntity<?> arg1) { // TODO Auto-generated method stub MethodUtils.writeLog("创建TABLE:" + arg1.getName()); } }).setDbUpgradeListener(new DbManager.DbUpgradeListener() { @Override public void onUpgrade(DbManager vdb,int oldVersion,int newVersion) { db = vdb; if (oldVersion != newVersion) { //如果数据库版本不同则升级结构 updateDBStructure(db); } } });
查看现有数据库版本, 用.dbinfo命令:
sqlite3 test.db >sqlite .dbinfo