1

how can i set a custom seq name in migration file?

we use a firebird db with jdbc adapter. in firebird, the column size is limit by 32. so the error msg is: Name longer than database column size

we had the same problem with index, but there you can set a custom name:

add_index :table_name, :column, :name => "custom_name_index"

1 Answer 1

1

Seems that firebird driver https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/firebird/adapter.rb

needs patching like in the oracle case https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arjdbc/oracle/adapter.rb

IDENTIFIER_LENGTH = 31
def default_sequence_name(table_name, column = nil)
  "#{table_name.to_s[0, IDENTIFIER_LENGTH - 4]}_seq"
end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.