@@ -47,16 +47,22 @@ public function up(): void
4747
4848 // Database Type test table
4949 // missing types:
50- // TINYINT,MEDIUMINT,BIT,YEAR,BINARY,VARBINARY,TINYTEXT,LONGTEXT,
51- // JSON,Spatial data types
50+ // TINYINT,MEDIUMINT,BIT,YEAR,BINARY,VARBINARY,TINYTEXT,LONGTEXT,
51+ // JSON,Spatial data types
5252 // `id` must be INTEGER else SQLite3 error on not null for autoincrement field.
5353 $ data_type_fields = [
54- 'id ' => ['type ' => 'INTEGER ' , 'constraint ' => 20 , 'auto_increment ' => true ],
55- 'type_varchar ' => ['type ' => 'VARCHAR ' , 'constraint ' => 40 , 'null ' => true ],
56- 'type_char ' => ['type ' => 'CHAR ' , 'constraint ' => 10 , 'null ' => true ],
57- 'type_text ' => ['type ' => 'TEXT ' , 'null ' => true ],
58- 'type_smallint ' => ['type ' => 'SMALLINT ' , 'null ' => true ],
59- 'type_integer ' => ['type ' => 'INTEGER ' , 'null ' => true ],
54+ 'id ' => ['type ' => 'INTEGER ' , 'constraint ' => 20 , 'auto_increment ' => true ],
55+ 'type_varchar ' => ['type ' => 'VARCHAR ' , 'constraint ' => 40 , 'null ' => true ],
56+ 'type_char ' => ['type ' => 'CHAR ' , 'constraint ' => 10 , 'null ' => true ],
57+ // TEXT should not be used on SQLSRV. It is deprecated.
58+ 'type_text ' => ['type ' => 'TEXT ' , 'null ' => true ],
59+ 'type_smallint ' => ['type ' => 'SMALLINT ' , 'null ' => true ],
60+ 'type_integer ' => ['type ' => 'INTEGER ' , 'null ' => true ],
61+ // FLOAT should not be used on MySQL.
62+ // CREATE TABLE t (f FLOAT, d DOUBLE);
63+ // INSERT INTO t VALUES(99.9, 99.9);
64+ // SELECT * FROM t WHERE f=99.9; // Empty set
65+ // SELECT * FROM t WHERE d=99.9; // 1 row
6066 'type_float ' => ['type ' => 'FLOAT ' , 'null ' => true ],
6167 'type_numeric ' => ['type ' => 'NUMERIC ' , 'constraint ' => '18,2 ' , 'null ' => true ],
6268 'type_date ' => ['type ' => 'DATE ' , 'null ' => true ],
0 commit comments