aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-10-09 19:16:55 +0000
committerstuconnolly <stuart02@gmail.com>2011-10-09 19:16:55 +0000
commitc8c91195ad32456400fc55377a33d466b6832ab3 (patch)
tree1c5bc316ae6138d3c396dba8c0583b1beb987e38 /Source/SPTableRelations.m
parent1fc5d271f03e0dc61605274aa87eb185a21e3f54 (diff)
downloadsequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.tar.gz
sequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.tar.bz2
sequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.zip
For some reason table creation on MySQL 4.0 servers doesn't like the engine/type being quoted.
Diffstat (limited to 'Source/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 5a81e756..eacdc8f6 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -38,7 +38,7 @@ static NSString *SPRelationColumnsKey = @"columns";
static NSString *SPRelationFKTableKey = @"fk_table";
static NSString *SPRelationFKColumnsKey = @"fk_columns";
static NSString *SPRelationOnUpdateKey = @"on_update";
-static NSString *SPRelationOnDeleteKey = @"on_delete";
+static NSString *SPRelationOnDeleteKey = @"on_delete";
@interface SPTableRelations ()
@@ -144,9 +144,9 @@ static NSString *SPRelationOnDeleteKey = @"on_delete";
NSString *query = [NSString stringWithFormat:@"ALTER TABLE %@ ADD ",[thisTable backtickQuotedString]];
- //set constraint name?
- if([[constraintName stringValue] length] > 0) {
- query = [query stringByAppendingString:[NSString stringWithFormat:@"CONSTRAINT %@ ",[[constraintName stringValue] backtickQuotedString]]];
+ // Set constraint name?
+ if ([[constraintName stringValue] length] > 0) {
+ query = [query stringByAppendingString:[NSString stringWithFormat:@"CONSTRAINT %@ ", [[constraintName stringValue] backtickQuotedString]]];
}
query = [query stringByAppendingString:[NSString stringWithFormat:@"FOREIGN KEY (%@) REFERENCES %@ (%@)",
@@ -154,7 +154,8 @@ static NSString *SPRelationOnDeleteKey = @"on_delete";
[thatTable backtickQuotedString],
[thatColumn backtickQuotedString]]];
- NSArray *onActions = [NSArray arrayWithObjects:@"RESTRICT",@"CASCADE",@"SET NULL",@"NO ACTION",nil];
+ NSArray *onActions = [NSArray arrayWithObjects:@"RESTRICT", @"CASCADE", @"SET NULL", @"NO ACTION", nil];
+
// If required add ON DELETE
if ([onDeletePopUpButton selectedTag] >= 0) {
query = [query stringByAppendingString:[NSString stringWithFormat:@" ON DELETE %@", [onActions objectAtIndex:[onDeletePopUpButton selectedTag]]]];
@@ -266,7 +267,6 @@ static NSString *SPRelationOnDeleteKey = @"on_delete";
if (changeEncoding) [connection restoreStoredEncoding];
[self selectReferenceTable:nil];
-
[self openRelationSheet:self];
}