aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseCopy.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseCopy.m')
-rw-r--r--Source/SPDatabaseCopy.m14
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m
index 66b6ba1b..c2371f3d 100644
--- a/Source/SPDatabaseCopy.m
+++ b/Source/SPDatabaseCopy.m
@@ -64,21 +64,15 @@
return NO;
}
- BOOL success = [self createDatabase:targetDatabaseName];
+ //abort here if database creation failed
+ if(![self createDatabase:targetDatabaseName])
+ return NO;
SPTableCopy *dbActionTableCopy = [[SPTableCopy alloc] init];
[dbActionTableCopy setConnection:connection];
- for (NSString *currentTable in tables) {
- if ([dbActionTableCopy copyTable:currentTable
- from:sourceDatabaseName
- to:targetDatabaseName
- withContent:copyWithContent]) {
- } else {
- success = NO;
- }
- }
+ BOOL success = [dbActionTableCopy copyTables:tables from:sourceDatabaseName to:targetDatabaseName withContent:copyWithContent];
[dbActionTableCopy release];