我想在“设置”表中存储“dbversion”记录,初始值为100。
public create_update_db() {
// dbversion: 101
// I want to dbversion value in settings table here.
If (value < 101) {
-> add, alter table or somethings else about dabase;
-> set dbversion value as 101
}
If (value < 102) {
-> add, alter table or somethings else about dabase;
-> set dbversion value as 102
}
// Every new db updates that I need, I'll add new lines here.
// And controlled all database with codes in CakePHP
}
我需要在哪里使用“create_update_db”程序?在App_contraller?或者在哪里。 此程序必须在任何页面加载之前调用...
答案 0 :(得分:0)