Guide to upgrade to 1.2.0 - Oracle

Added by Juan G about 11 years ago

Hi!

I've finally managed to get redmine 1.2.0 working with Oracle Database. I've upgraded from 1.0.1 to 1.2.0. Althought using JRuby I suppose this method can be used with native Ruby.

Below I give the necessary steps to achieve it:

  • My working gem list:
*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activerecord-jdbc-adapter (1.1.1)
activerecord-oracle_enhanced-adapter (1.3.1)
activeresource (2.3.11)
activesupport (2.3.11)
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundler (1.0.14)
erubis (2.6.6)
i18n (0.4.2)
jruby-jars (1.6.2)
jruby-openssl (0.7.4)
jruby-rack (1.0.9)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (2.3.11)
rake (0.8.7)
rubyzip (0.9.4)
sources (0.0.1)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.27)
warbler (1.3.1)

* First you'll have to patch your redmine 1.2.0. sources with patch attached.
  • Execute the upgrade process as usual.
  • I've commented some upgrade scripts, because Oracle doesn't like changing VARCHAR to CLOB directly with ALTER TABLE, so you'll have to execute this SQL:
ALTER TABLE JOURNAL_DETAILS ADD tmp_old_value CLOB;

UPDATE JOURNAL_DETAILS SET tmp_old_value=old_value;

ALTER TABLE JOURNAL_DETAILS DROP COLUMN old_value;

ALTER TABLE JOURNAL_DETAILS RENAME COLUMN tmp_old_value to old_value;

ALTER TABLE JOURNAL_DETAILS ADD tmp_value CLOB;

UPDATE JOURNAL_DETAILS SET tmp_value=value;

ALTER TABLE JOURNAL_DETAILS DROP COLUMN value;

ALTER TABLE JOURNAL_DETAILS RENAME COLUMN tmp_value to value;

  • To work ok with Oracle the best option I've found is with oracle_enhanced adapter (at least in my environment working with jruby). In config/initializers there must be created (after applied patch above) a file named oracle_enhanced.rb. You'll have to change database.yml config to use it.
  • Lastly, I've found a problem while using custom filters and custom fields, because Oracle doesn't like making some queries usings CLOBS. To solve this you'll have to revert that field to VARCHAR2:
ALTER TABLE CUSTOM_VALUES ADD tmp_value VARCHAR2(4000);

UPDATE CUSTOM_VALUES SET tmp_value=value;

ALTER TABLE CUSTOM_VALUES DROP COLUMN value;

ALTER TABLE CUSTOM_VALUES RENAME COLUMN tmp_value to value;

And that's all!

patch-redmine_1.2.0_Oracle.diff Magnifier - patch for redmine 1.2.0 and Oracle (7.27 KB)