constSQL_CREATE_TABLE='CREATE TABLE IF NOT EXISTS EMPLOYEE (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL, AGE INTEGER, SALARY REAL, CODES BLOB)';// 建表Sql语句
// version = 2:表结构:EMPLOYEE (NAME, AGE, SALARY, CODES, ADDRESS) => version = 3:表结构:EMPLOYEE (NAME, SALARY, CODES, ADDRESS)
store.executeSql("ALTER TABLE EMPLOYEE DROP COLUMN AGE INTEGER",null);
store.version=3;
}
// 这里执行数据库的增、删、改、查等操作
});
}
}
...
...
@@ -98,14 +120,36 @@
};
constSQL_CREATE_TABLE='CREATE TABLE IF NOT EXISTS EMPLOYEE (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL, AGE INTEGER, SALARY REAL, CODES BLOB)';// 建表Sql语句