Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何为某表增加一个字段? #194

Open
FeiCheung opened this issue Aug 30, 2016 · 1 comment
Open

如何为某表增加一个字段? #194

FeiCheung opened this issue Aug 30, 2016 · 1 comment

Comments

@FeiCheung
Copy link

我是做移动开发
比如现在有个表user
if (window.openDatabase) {
persistence.store.websql.config(persistence, 'testdb',
'My SQLite database', 5 * 1024 * 1024);
} else {
persistence.store.memory.config(persistence);
}

var User = persistence.define('User', {
name: "TEXT",
age: "INTEGER"
});
persistence.schemaSync();
user表有两个字段 name 和 age 我现在想增加一个字段比如 sex
var User = persistence.define('User', {
name: "TEXT",
age: "INTEGER",
sex:"TEXT"
}); 当我这样写完之后,重新运行程序sex字段却不存在 , 需要我卸载应用重新生成数据库才能建立此字段。 这个问题如何解决呢? 总不能每次表结构变动了 就重新安装程序吧,求大神指导。。

@ceeji
Copy link

ceeji commented Sep 25, 2016

Why don't you use English?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants