frioux / DBIx-Class-DeploymentHandler

https://metacpan.org/pod/DBIx::Class::DeploymentHandler
21 stars 26 forks source link

Invalid Postgres downgrade SQL generated #32

Closed robrwo closed 9 years ago

robrwo commented 9 years ago

An upgrade changed a column from integer to text.

The corresponding downgrade SQL was something like:

ALTER TABLE mytable ALTER COLUMN mycol TYPE integer;

In Postgres, tt should be:

ALTER TABLE mytable ALTER COLUMN mycol TYPE integer USING (my_col::integer);

Is this an SQL::Translator issue or a DBICDH issue?

frioux commented 9 years ago

Yeah that's a SQL::Translator issue, sorry!

robrwo commented 9 years ago

Reported in SQLT at https://rt.cpan.org/Ticket/Display.html?id=101704