Comments (3)
此部分目前只有两个接口, 关于迁移, 后续会完善
/**
增加新字段, 在建表后还想新增字段,可以在原建表model或新model中新增对应属性,然后传入即可新增该字段,该操作已在事务中执行
@param tableName 表的名称
@param parameters 如果传Model:数据库新增字段为建表时model所没有的属性,如果传dictionary格式为@{@"newname":@"TEXT"}
@param nameArr 不允许生成字段的属性名的数组
@return 是否成功
*/
- (BOOL)jq_alterTable:(NSString *)tableName dicOrModel:(id)parameters excludeName:(NSArray *)nameArr;
- (BOOL)jq_alterTable:(NSString *)tableName dicOrModel:(id)parameters;
from jqfmdb.
[db jq_inDatabase:^{
if (![db jq_isExistTable:tablename]) {
[db jq_createTable:tablename dicOrModel:model];
}
else
{
[db jq_alterTable:tablename dicOrModel:model];
}
这么写会报错 大神该在哪里调用啊
from jqfmdb.
报错的原因是因为死锁, alter不要在block内调用(jq_inDatabase:^), 因为新增字段已经在事务里处理了
from jqfmdb.
Related Issues (20)
- Message from debugger: Terminated due to memory issue HOT 1
- 创建单例问题
- 删除了所有数据的问题
- 查询的时候崩溃,之前存的是模型 HOT 2
- 支持模型嵌套吗? HOT 1
- 希望能添加对某些字段的查询方法,
- 模糊查询传入参数的时候会出现Bug。
- model中添加pkid属性创建表失败
- 真机donwload的包里的数据库数据更新了,然而查询的时候还是老数据。
- 我想把存入数据的其中一个字段设为主键,要怎么做
- swift HOT 2
- pod安装不支持osx HOT 1
- 建表的问题 HOT 2
- 还在维护当中吗
- 数据库升级问题,能否自动升级呢?
- 使用model创建数据库失败
- 多条件查询 怎么不支持呢大佬
- FMDB SQL注入问题发现
- 如何在已有的表,新增字段?
- 这个库还在维护吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jqfmdb.