kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

OCIError: ORA-00904 #83

Closed Dharshi closed 9 years ago

Dharshi commented 9 years ago

I have done following updates

rails from 4.1.0 to 4.2.3 activerecord-oracle_enhanced-adapter from 1.5.5 to 1.6.0 ruby-oci8 from 2.1.7 to 2.1.8

when I run bundle exec rake db:schema:load

it results following error

add_index("users", ["LOWER(\"USER_ID\")"], {:name=>"index_users_on_lower_user_id", :unique=>true}) rake aborted! ActiveRecord::StatementInvalid: OCIError: ORA-00904: : invalid identifier: ALTER TABLE "USERS" ADD CONSTRAINT "INDEX_USERS_ON_LOWER_USER_ID" UNIQUE (LOWER("USER_ID")) stmt.c:250:in oci8lib_220.bundle

/Users/dharshi/.rvm/gems/ruby-2.2.1@iteach/gems/ruby-oci8-2.1.8/lib/oci8/cursor.rb:129:in `exec'

kubo commented 9 years ago

This isn't a ruby-oci8 issue. Could you report the issue to oracle_enhanced instead of ruby-oci8? IMO, the combination of rails 4.1.0 and oracle_enhanced 1.5.5 generates CREAE INDEX... statement for add_index(...). But the combination of rails 4.2.3 and oracle_enhanced 1.6.0 uses ALTER TABLE ... ADD CONSTRAINT ... for it.