diff --git a/pg_chameleon/lib/pg_lib.py b/pg_chameleon/lib/pg_lib.py index 389ca5d84b826172d1ef5753fb258db7134a0c3b..896a56622468954b970b089c99848b5346dbcda8 100644 --- a/pg_chameleon/lib/pg_lib.py +++ b/pg_chameleon/lib/pg_lib.py @@ -2458,7 +2458,7 @@ class pg_engine(object): if (column_type == ColumnType.O_C_CHAR_VAR.value or column_type == ColumnType.O_C_CHARACTER.value) and\ int(column["character_maximum_length"]) > 0: column_type="%s (%s)" % (column_type, str(column["character_maximum_length"])) - if column_type == ColumnType.O_NUM.value and str(column["numeric_scale"]) != "None": + if column_type == ColumnType.O_NUM.value and ('numeric_scale' in column.keys()) and str(column["numeric_scale"]) != "None": column_type="%s (%s,%s)" % (column_type, str(column["numeric_precision"]), str(column["numeric_scale"])) if column["extra"] == "auto_increment": column_type = ColumnType.O_BIGSERIAL.value diff --git a/pg_chameleon/lib/sql_util.py b/pg_chameleon/lib/sql_util.py index 7d7f8b77bc8ebea68235297bba0d851fd3524a8f..0701a4aea8923f369db0e9ea3ddc98adbef63566 100644 --- a/pg_chameleon/lib/sql_util.py +++ b/pg_chameleon/lib/sql_util.py @@ -218,7 +218,7 @@ class sql_token(object): try: numeric_scale = numeric_dims[1].strip() except: - numeric_scale = 0 + numeric_scale = "None" col_dic["enum_list"] = enum_list col_dic["character_maximum_length"] = dimensions