backlogs/redmine_backlogs — pull request #523 by patrickatamaniuk (2012-05-07 21:20:08+00:00)
Title: Unique positions migration: support postgres transaction

rake redmine:backlogs:install
1.4.1.stable
...
Story and task trackers are now set.
Migrating the database...** Invoke db:migrate:plugins (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate:plugins
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR: current transaction is aborted, commands ignored until end of transaction block
: create table _backlogs_tmp_position (issue_id int not null unique, new_position int not null unique)
/usr/share/ruby-rvm/gems/ruby-1.8.7-p352/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
...

Postgres migration runs within a transaction. It is aborted if 'drop table' fails on non-existing table.
begin - rescue - end does not prevent the transaction from being aborted.