diff options
author | stuconnolly <stuart02@gmail.com> | 2011-06-19 13:38:43 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-06-19 13:38:43 +0000 |
commit | f5292a63a71f365e5863e3ed977b955736daabea (patch) | |
tree | 3780e59f5b8d8d1888a2fc61b5f01435534caee6 /Source | |
parent | d2b26455c859064af12022459652a804d2be1750 (diff) | |
download | sequelpro-f5292a63a71f365e5863e3ed977b955736daabea.tar.gz sequelpro-f5292a63a71f365e5863e3ed977b955736daabea.tar.bz2 sequelpro-f5292a63a71f365e5863e3ed977b955736daabea.zip |
With the exception of CSV tables, make the initial ID column the primary key as well as auto increment. Implementes issue #297.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPTableFieldValidation.m | 2 | ||||
-rw-r--r-- | Source/SPTablesList.m | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPTableFieldValidation.m b/Source/SPTableFieldValidation.m index ceee9b3b..0811aa33 100644 --- a/Source/SPTableFieldValidation.m +++ b/Source/SPTableFieldValidation.m @@ -25,7 +25,7 @@ #import "SPTableFieldValidation.h" -@interface SPTableFieldValidation (PrivateAPI) +@interface SPTableFieldValidation () - (NSString *)_formatType:(NSString *)type; diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index fe43c845..be9e54d7 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -2196,7 +2196,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; engineStatement = [NSString stringWithFormat:@"%@ = %@", [[tableDocumentInstance serverSupport] engineTypeQueryName], [tableType backtickQuotedString]]; } - NSString *createStatement = [NSString stringWithFormat:@"CREATE TABLE %@ (%@) %@ %@", [tableName backtickQuotedString], ([tableType isEqualToString:@"CSV"]) ? @"id INT NOT NULL" : @"id INT", charSetStatement, engineStatement]; + NSString *createStatement = [NSString stringWithFormat:@"CREATE TABLE %@ (id INT(11) UNSIGNED NOT NULL%@) %@ %@", [tableName backtickQuotedString], [tableType isEqualToString:@"CSV"] ? @"" : @" PRIMARY KEY AUTO_INCREMENT", charSetStatement, engineStatement]; // Create the table [mySQLConnection queryString:createStatement]; |