diff options
author | stuconnolly <stuart02@gmail.com> | 2010-04-09 13:01:52 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-04-09 13:01:52 +0000 |
commit | 3b59093cd3d5be30a809bdc6bb9f3ba63c9ce275 (patch) | |
tree | bbfc2cd6215a74f33eea50e768761ed0a050fb44 | |
parent | 965abac73b603c464dc9d58ce4778f239ff6e2b9 (diff) | |
download | sequelpro-3b59093cd3d5be30a809bdc6bb9f3ba63c9ce275.tar.gz sequelpro-3b59093cd3d5be30a809bdc6bb9f3ba63c9ce275.tar.bz2 sequelpro-3b59093cd3d5be30a809bdc6bb9f3ba63c9ce275.zip |
When displaying a table/view's create syntax in the extended table information view or create syntax sheet remember to append a semi-colon. Fixes issue #629.
-rw-r--r-- | Source/SPExtendedTableInfo.m | 8 | ||||
-rw-r--r-- | Source/TableDocument.m | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 9636ca4c..98994acf 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -237,7 +237,8 @@ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""]; [tableCreateSyntaxTextView setString:@""]; - NSString *createViewSyntax = [[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier]; + NSString *createViewSyntax = [[[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier] stringByAppendingString:@";"]; + if (createViewSyntax) { [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:createViewSyntax]; [tableCreateSyntaxTextView insertText:createViewSyntax]; @@ -281,6 +282,7 @@ NSArray *collations = [databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]]; if (([engines count] > 0) && ([statusFields objectForKey:@"Engine"])) { + // Populate type popup button for (NSDictionary *engine in engines) { @@ -351,14 +353,14 @@ [tableCommentsTextView setString:[statusFields objectForKey:@"Comment"]]; [tableCommentsTextView didChangeText]; [tableCommentsTextView setEditable:enableInteraction]; - + // Set create syntax [tableCreateSyntaxTextView setEditable:YES]; [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""]; [tableCreateSyntaxTextView setString:@""]; [tableCreateSyntaxTextView didChangeText]; [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:[tableDataInstance tableCreateSyntax]]; - [tableCreateSyntaxTextView insertText:[tableDataInstance tableCreateSyntax]]; + [tableCreateSyntaxTextView insertText:[[tableDataInstance tableCreateSyntax] stringByAppendingString:@";"]]; [tableCreateSyntaxTextView didChangeText]; [tableCreateSyntaxTextView setEditable:NO]; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index bd12b9bf..ab8a7ac5 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1684,10 +1684,10 @@ } [createTableSyntaxTextField setStringValue:[NSString stringWithFormat:@"Create syntax for %@ '%@'", typeString, [self table]]]; - + [createTableSyntaxTextView setEditable:YES]; [createTableSyntaxTextView setString:@""]; - [createTableSyntaxTextView insertText:([tablesListInstance tableType] == SPTableTypeView) ? [tableSyntax createViewSyntaxPrettifier] : tableSyntax]; + [createTableSyntaxTextView insertText:([tablesListInstance tableType] == SPTableTypeView) ? [[tableSyntax createViewSyntaxPrettifier] stringByAppendingString:@";"] : [tableSyntax stringByAppendingString:@";"]]; [createTableSyntaxTextView setEditable:NO]; [createTableSyntaxWindow makeFirstResponder:createTableSyntaxTextField]; |