aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExtendedTableInfo.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-04-09 19:03:14 +0000
committerrowanbeentje <rowan@beent.je>2012-04-09 19:03:14 +0000
commit6e9ab89e7c9085072036179b9c71906e53318ee0 (patch)
treec77f4e4994fac64b76479fae53a20cfe8f4e29f1 /Source/SPExtendedTableInfo.m
parent761ee77727eb18e0ed6980ea98ea723cb8b3e817 (diff)
downloadsequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.tar.gz
sequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.tar.bz2
sequelpro-6e9ab89e7c9085072036179b9c71906e53318ee0.zip
- Alphabetically sort table engines, addressing Issue #1316
- If a table has no rows, don't show the data loss warning when altering table engine
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r--Source/SPExtendedTableInfo.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 89403615..23f3c426 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -90,12 +90,18 @@ static NSString *SPUpdateTableTypeNewType = @"SPUpdateTableTypeNewType";
// Check if the user selected the same type
if ([currentType isEqualToString:newType]) return;
-
+
+ // If the table is empty, perform the change directly
+ if ([[[tableDataInstance statusValues] objectForKey:@"Rows"] isEqualToString:@"0"]) {
+ [self _changeCurrentTableTypeFrom:currentType to:newType];
+ return;
+ }
+
NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Change table type", @"change table type message")
defaultButton:NSLocalizedString(@"Change", @"change button")
alternateButton:NSLocalizedString(@"Cancel", @"cancel button")
otherButton:nil
- informativeTextWithFormat:NSLocalizedString(@"Are you sure you want to change this table's type to %@?\n\nPlease be aware that changing a table's type has the potential to cause the loss of some or all of it's data. This action cannot be undone.", @"change table type informative message"), newType];
+ informativeTextWithFormat:NSLocalizedString(@"Are you sure you want to change this table's type to %@?\n\nPlease be aware that changing a table's type has the potential to cause the loss of some or all of its data. This action cannot be undone.", @"change table type informative message"), newType];
[alert setAlertStyle:NSCriticalAlertStyle];