Skip to content

integer(4) is not valid in some database systems #336

Open
c33s opened this Issue Apr 10, 2012 · 2 comments

2 participants

@c33s
c33s commented Apr 10, 2012

for postgres it is not valid to use integer(x) http://www.postgresql.org/docs/8.1/static/datatype.html#DATATYPE-NUMERIC
postgres maps all integers to a own name.

propel converts

<column name="id" phpName="Id" type="INTEGER" size="4" ...

to a

 ...
... integer(4) ....
...

which fails with postgres.

as far as i reserched it is also invalid for ansi sql. https://en.wikipedia.org/wiki/SQL

would be good if it would be converted to a regular integer for postgres (or maybe for all databases, as far as i know mysql is fine with smallint, integer and bigint is it?.

@willdurand
Propel member

If it's true, then you just have to add a new rule to this class: https://github.com/propelorm/Propel/blob/master/generator/lib/platform/PgsqlPlatform.php using the PropelTypes::INTEGER constant.

@themouette do you use INTEGER types in your schema?

@willdurand
Propel member

@themouette again..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.