diff options
author | drx777 <david.rekowski@gmx.de> | 2010-04-29 18:42:54 +0000 |
---|---|---|
committer | drx777 <david.rekowski@gmx.de> | 2010-04-29 18:42:54 +0000 |
commit | 6f6a32030c374acc5afd253bc3a8f6488d0b9433 (patch) | |
tree | 4d721f5155490f9bf9e0f9ee3cd3d64c41dd85cc /Source/SPDatabaseCopy.m | |
parent | 230f6295f5c6a80201410bc0347e83920df08bfe (diff) | |
download | sequelpro-6f6a32030c374acc5afd253bc3a8f6488d0b9433.tar.gz sequelpro-6f6a32030c374acc5afd253bc3a8f6488d0b9433.tar.bz2 sequelpro-6f6a32030c374acc5afd253bc3a8f6488d0b9433.zip |
Only switch to the renamed/duplicated database name, if the action was successful. Caused an existing DB to be selected, after ren/dup failed because it exists.
Diffstat (limited to 'Source/SPDatabaseCopy.m')
-rw-r--r-- | Source/SPDatabaseCopy.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m index 5f0c8fe8..2d5f92c3 100644 --- a/Source/SPDatabaseCopy.m +++ b/Source/SPDatabaseCopy.m @@ -63,7 +63,7 @@ } DLog(@"list of found tables of source db: %@", tables); - [self createDatabase:targetDatabaseName]; + BOOL success = [self createDatabase:targetDatabaseName]; SPTableCopy *dbActionTableCopy = [[SPTableCopy alloc] init]; [dbActionTableCopy setConnection:connection]; @@ -72,8 +72,11 @@ from:sourceDatabaseName to:targetDatabaseName withContent:copyWithContent]) { + } else { + success = NO; } } + return success; } - (BOOL) createDatabase: (NSString *)newDatabaseName { |