diff --git a/setup.cfg b/setup.cfg index e776854..2e9c94d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ProcruSQL -version = 0.0.7 +version = 0.0.8 author = Peter J. Holzer author_email = hjp@hjp.at description = Make a database fit its description diff --git a/src/procrusql/parser.py b/src/procrusql/parser.py index 87a59f2..3cb00d8 100755 --- a/src/procrusql/parser.py +++ b/src/procrusql/parser.py @@ -291,7 +291,7 @@ def parse_column_definition(ps): "text", "character varying", "date", "timestamp with time zone", "timestamptz" ) - pattern = "(" + "|".join(sqltypes) + ")" + r"([ \t]+default .*)?([ \t]+not null)?([ \t]+(primary key|unique|references \w+))?\b" + pattern = "(" + "|".join(sqltypes) + ")" + r"([ \t]+(default .*|not null\b|primary key\b|unique\b|references \w+\b))*" m = ps2.match(pattern) if not m: ps.record_child_failure(ps2, "expected column definition")