fix missing typmod in generated sql

ie the max length of a varchar or the scale and precision of a numeric

closes #66
This commit is contained in:
eelke 2020-10-15 19:21:44 +02:00
parent 2faedca137
commit 87553b2554

View file

@ -21,8 +21,7 @@ QString PgAttribute::columnDefinition(const PgDatabaseCatalog &cat) const
type_str = "BIGSERIAL"; type_str = "BIGSERIAL";
} }
else { else {
auto&& type = cat.types()->getByKey(typid); type_str = getTypeDisplayString(cat, typid, typmod);
type_str = type->objectName();
} }
QString sql = quoteIdent(name) % " " % type_str; QString sql = quoteIdent(name) % " " % type_str;