@@ -8,7 +8,7 @@ class ezSchema
88 const STRINGS = [
99 'common ' => ['CHAR ' , 'VARCHAR ' , 'TEXT ' ],
1010 'mysqli ' => ['TINYTEXT ' , 'MEDIUMTEXT ' , 'LONGTEXT ' , 'BINARY ' , 'VARBINARY ' ],
11- 'pgsql ' => ['character ' , 'character varying ' ],
11+ 'pgsql ' => ['CHARACTER ' , 'CHARACTER VARYING ' ],
1212 'sqlsrv ' => ['NCHAR ' , 'NVARCHAR ' , 'NTEXT ' , 'BINARY ' , 'VARBINARY ' , 'IMAGE ' ],
1313 'sqlite3 ' => ['TINYTEXT ' , 'MEDIUMTEXT ' , 'LONGTEXT ' , 'NCHAR ' , 'NVARCHAR ' , 'CLOB ' ]
1414 ];
@@ -17,9 +17,9 @@ class ezSchema
1717 'common ' => ['INT ' ],
1818 'mysqli ' => ['BIT ' , 'INTEGER ' , 'TINYINT ' , 'SMALLINT ' , 'MEDIUMINT ' , 'BIGINT ' , 'FLOAT ' ,
1919 'BOOL ' , 'BOOLEAN ' ],
20- 'pgsql ' => ['bit ' , 'varbit ' , 'bit varying ' , 'smallint ' , 'int ' , 'integer ' ,
21- 'bigint ' , 'smallserial ' , 'serial ' , 'bigserial ' , 'double precision ' , 'real ' ,
22- 'money ' , 'bool ' , 'boolean ' ],
20+ 'pgsql ' => ['BIT ' , 'VARBIT ' , 'BIT VARYING ' , 'SMALLINT ' , 'INT ' , 'INTEGER ' ,
21+ 'BIGINT ' , 'SMALLSERIAL ' , 'SERIAL ' , 'BIGSERIAL ' , 'DOUBLE PRECISION ' , 'REAL ' ,
22+ 'MONEY ' , 'BOOL ' , 'BOOLEAN ' ],
2323 'sqlsrv ' => ['BIT ' , 'TINYINT ' , 'SMALLINT ' , 'BIGINT ' , 'SMALLMONEY ' , 'MONEY ' ,
2424 'FLOAT ' , 'REAL ' ],
2525 'sqlite3 ' => ['TINYINT ' , 'SMALLINT ' , 'MEDIUMINT ' , 'BIGINT ' , 'INTEGER ' , 'INT2 ' ,
@@ -38,8 +38,8 @@ class ezSchema
3838 'common ' => ['DATE ' , 'TIMESTAMP ' , 'TIME ' ],
3939 'mysqli ' => ['DATETIME ' , 'YEAR ' ],
4040 'pgsql ' => [
41- 'timestamp without time zone ' , 'timestamp with time zone ' ,
42- 'time without time zone ' , 'time with time zone '
41+ 'TIMESTAMP WITHOUT TIME ZONE ' , 'TIMESTAMP WITH TIME ZONE ' ,
42+ 'TIME WITHOUT TIME ZONE ' , 'TIME WITH TIME ZONE '
4343 ],
4444 'sqlsrv ' => ['DATETIME ' , 'DATETIME2 ' , 'SMALLDATETIME ' , 'DATETIMEOFFSET ' ],
4545 'sqlite3 ' => ['DATETIME ' ]
@@ -113,7 +113,7 @@ public function __call($type, $args)
113113 // check for string data type
114114 $ numberOrString = $ args [0 ];
115115 $ store = \is_int ($ numberOrString ) ? '( ' .$ numberOrString .') ' : '' ;
116- $ store = empty ($ store ) && !empty ($ numberOrString ) ? $ numberOrString : $ store ;
116+ $ store = empty ($ store ) && !empty ($ numberOrString ) ? ' ' . $ numberOrString : $ store ;
117117 $ value = !empty ($ args [1 ]) ? ' ' .$ args [1 ] : '' ;
118118 $ options = !empty ($ args [2 ]) ? ' ' .$ args [2 ] : '' ;
119119 $ extra = !empty ($ args [3 ]) ? ' ' .$ args [3 ] : '' ;
@@ -130,7 +130,7 @@ public function __call($type, $args)
130130 // check for whole number data type
131131 $ numberOrString = $ args [0 ];
132132 $ store = \is_int ($ numberOrString ) ? '( ' .$ numberOrString .') ' : '' ;
133- $ store = empty ($ store ) && !empty ($ numberOrString ) ? $ numberOrString : $ store ;
133+ $ store = empty ($ store ) && !empty ($ numberOrString ) ? ' ' . $ numberOrString : $ store ;
134134 $ value = !empty ($ args [1 ]) ? ' ' .$ args [1 ] : '' ;
135135 $ options = !empty ($ args [2 ]) ? ' ' .$ args [2 ] : '' ;
136136 $ extra = !empty ($ args [3 ]) ? ' ' .$ args [3 ] : '' ;
@@ -139,13 +139,13 @@ public function __call($type, $args)
139139 // check for date time data type
140140 $ numberOrString = $ args [0 ];
141141 $ store = \is_int ($ numberOrString ) ? '( ' .$ numberOrString .') ' : '' ;
142- $ fraction = empty ($ store ) && !empty ($ numberOrString ) ? $ numberOrString : $ store ;
142+ $ fraction = empty ($ store ) && !empty ($ numberOrString ) ? ' ' . $ numberOrString : $ store ;
143143 $ value = !empty ($ args [1 ]) ? ' ' .$ args [1 ] : '' ;
144144 $ options = !empty ($ args [2 ]) ? ' ' .$ args [2 ] : '' ;
145145 $ data = $ type .$ fraction .$ value .$ options ;
146146 } elseif (\preg_match ($ objectPattern , $ type )) {
147147 // check for large object data type
148- $ value = !empty ($ args [0 ]) ? ' ' .$ args [0 ] : '' ;
148+ $ value = !empty ($ args [0 ]) ? ' ' .$ args [0 ] : ' ' ;
149149 $ data = $ type .$ value ;
150150 } else {
151151 throw new \Exception ("$ type does not exist " );
0 commit comments