Skip to content

Commit 9b19171

Browse files
committed
Fix Bug
1 parent e430c4f commit 9b19171

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

SJDBMap.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = "SJDBMap"
4-
s.version = "1.0.4"
4+
s.version = "1.0.5"
55
s.summary = "Automatically create tables based on the model."
66
s.description = "https://github.com/changsanjiang/SJDBMap/blob/master/README.md"
77
s.homepage = "https://github.com/changsanjiang/SJDBMap"

SJDBMap/SJDatabaseMap+GetInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ - (NSString *)sjGetInsertOrUpdateSuffixSQL:(id<SJDBMapUseProtocol>)model {
185185

186186
[aK enumerateObjectsUsingBlock:^(SJDBMapArrayCorrespondingKeysModel * _Nonnull ACKM, NSUInteger idx, BOOL * _Nonnull stop) {
187187
NSArray<id> *cValues = [(id)model valueForKey:ACKM.ownerFields];
188-
if ( [fields isEqualToString:ACKM.ownerFields] ) {
188+
if ( [fields isEqualToString:ACKM.ownerFields] && !cValues.count ) {
189189

190190
SJDBMapPrimaryKeyModel *pM = [self sjGetPrimaryKey:[cValues[0] class]];
191191
SJDBMapAutoincrementPrimaryKeyModel *aPM = [self sjGetAutoincrementPrimaryKey:[cValues[0] class]];

SJDBMap/SJDatabaseMap+Server.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ - (void)sjAutoCreateOrAlterRelevanceTabWithClass:(Class)cls {
151151
[self _sjConversionModelWithOwnerModel:model dict:dict cKr:cKr aKr:aKr];
152152
[allDataModel addObject:model];
153153
}];
154+
if ( 0 == allDataModel.count ) return nil;
154155
return allDataModel;
155156
}
156157

@@ -197,6 +198,7 @@ - (void)sjAutoCreateOrAlterRelevanceTabWithClass:(Class)cls {
197198
[self _sjConversionModelWithOwnerModel:model dict:dict cKr:cKr aKr:aKr];
198199
[allDataModel addObject:model];
199200
}];
201+
if ( 0 == allDataModel.count ) return nil;
200202
return allDataModel;
201203
}
202204

0 commit comments

Comments
 (0)