From f8a9ce93bcf9ee3db418c371106c9eb87d8b61d0 Mon Sep 17 00:00:00 2001 From: Stuart Connolly Date: Tue, 14 Jan 2014 23:04:05 +0000 Subject: Use data type constants. --- Source/SPTableStructure.m | 93 +++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 47 deletions(-) (limited to 'Source/SPTableStructure.m') diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 72c357d9..5b97c6b9 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -125,56 +125,55 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; // Note that changing the contents or ordering of this array will affect the implementation of // SPTableFieldValidation. See it's implementation file for more details. - typeSuggestions = [[NSArray arrayWithObjects: - @"TINYINT", - @"SMALLINT", - @"MEDIUMINT", - @"INT", - @"BIGINT", - @"FLOAT", - @"DOUBLE", - @"DOUBLE PRECISION", - @"REAL", - @"DECIMAL", - @"BIT", - @"SERIAL", - @"BOOL", - @"BOOLEAN", - @"DEC", - @"FIXED", - @"NUMERIC", + typeSuggestions = [@[ + SPMySQLTinyIntType, + SPMySQLSmallIntType, + SPMySQLMediumIntType, + SPMySQLIntType, + SPMySQLBigIntType, + SPMySQLFloatType, + SPMySQLDoubleType, + SPMySQLDoublePrecisionType, + SPMySQLRealType, + SPMySQLDecimalType, + SPMySQLBitType, + SPMySQLSerialType, + SPMySQLBoolType, + SPMySQLBoolean, + SPMySQLDecType, + SPMySQLFixedType, + SPMySQLNumericType, @"--------", - @"CHAR", - @"VARCHAR", - @"TINYTEXT", - @"TEXT", - @"MEDIUMTEXT", - @"LONGTEXT", - @"TINYBLOB", - @"MEDIUMBLOB", - @"BLOB", - @"LONGBLOB", - @"BINARY", - @"VARBINARY", - @"ENUM", - @"SET", + SPMySQLCharType, + SPMySQLVarCharType, + SPMySQLTinyTextType, + SPMySQLTextType, + SPMySQLMediumTextType, + SPMySQLLongTextType, + SPMySQLTinyBlobType, + SPMySQLMediumBlobType, + SPMySQLBlobType, + SPMySQLLongBlobType, + SPMySQLBinaryType, + SPMySQLVarBinaryType, + SPMySQLEnumType, + SPMySQLSetType, @"--------", - @"DATE", - @"DATETIME", - @"TIMESTAMP", - @"TIME", - @"YEAR", + SPMySQLDateType, + SPMySQLDatetimeType, + SPMySQLTimestampType, + SPMySQLTimeType, + SPMySQLYearType, @"--------", - @"GEOMETRY", - @"POINT", - @"LINESTRING", - @"POLYGON", - @"MULTIPOINT", - @"MULTILINESTRING", - @"MULTIPOLYGON", - @"GEOMETRYCOLLECTION", - nil] retain]; - + SPMySQLGeometryType, + SPMySQLPointType, + SPMySQLLineStringType, + SPMySQLPolygonType, + SPMySQLMultiPointType, + SPMySQLMultiLineStringType, + SPMySQLMultiPolygonType, + SPMySQLGeometryCollectionType] retain]; + [fieldValidation setFieldTypes:typeSuggestions]; // Add observers for document task activity -- cgit v1.2.3