Skip to content

Commit cc53c23

Browse files
committed
Update type parsing
1 parent 2a719c1 commit cc53c23

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/sql_bridge_mysql_otp.erl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
maybe_replace_tokens/2
2121
]).
2222

23+
-export([parse_field_type/1]).
2324
%-export([maybe_replace_tokens/2]).
2425

2526

@@ -324,8 +325,8 @@ parse_field_type("uuid") ->
324325
{uuid, undefined};
325326
parse_field_type(FieldType) ->
326327
RETypes = "(tinyint|smallint|mediumint|int|bigint|varchar|char)",
327-
RELength = "\\(([0-9]+)\\)",
328-
REFollower = "(.*?)",
328+
RELength = "(?:\\(([0-9]+)\\))?",
329+
REFollower = "(signed|unsigned)?",
329330
RE = "^" ++ RETypes ++ "\\s*" ++ RELength ++ "\\s*" ++ REFollower ++ "$",
330331
case re:run(FieldType, RE, [{capture, all_but_first, binary}]) of
331332
{match, [Type, Length | _]} when Type == <<"varchar">>;

0 commit comments

Comments
 (0)