phinx
phinx copied to clipboard
Postgre types
How is it possible to set a column type in postgre from this list https://www.postgresql.org/docs/9.5/static/datatype.html ? In the documentation, it is only information about "smallint, json, jsonb and uuid" but there is much more types in postgresql, for example: daterange is a valid column type. Also, what about custom types? https://www.postgresql.org/docs/9.5/static/sql-createtype.html Is it already possible to use them in phinx? If not, it would be really useful to have. Don't you think so?
Just start coding and provide a PR per feature.
Are you able to provide a patch with your suggested changes as PR?
PR welcome.
For reference, if you want to use a type that phinx does not support, you can do it by using a Phinx\Util\Literal, like so:
$this->table('users')
->addColumn('username', Literal::from('daterange'))
->create();
See https://book.cakephp.org/phinx/0/en/migrations.html#custom-column-types-default-values for more information.