jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3608

change_column_null is missing from activerecord-jdbcpostgresql-adapter

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Fedora 10, Sun Java 1.6.0_11, JRuby 1.2.0, activerecord-jdbc-adapter 0.9.1, activerecord-jdbcpostgresql-adapter 0.9.1

Description

When doing

    change_column_null :events, :end_at, true

in a migration script, a "method missing" exception is thrown. This works on older versions of ar-jdbc and on MRI with regular postgresql adapter.

As a workaround, inserting the following code in environment.rb in Rails, or other appropriate setup code will add the missing method:

module ::JdbcSpec::PostgreSQL
  def change_column_null(table_name, column_name, null, default = nil)
    unless null || default.nil?
      execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL")
    end
    execute("ALTER TABLE #{quote_table_name(table_name)} ALTER #{quote_column_name(column_name)} #{null ? 'DROP' : 'SET'} NOT NULL")
  end

Please add back the missing method. It should already be defined in the regular postgresql adapter, so we really only need to not disable it.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Nick Sieger added a comment - 01/Oct/09 2:48 PM

In ar-jdbc dbfba06.

Show
Nick Sieger added a comment - 01/Oct/09 2:48 PM In ar-jdbc dbfba06.

People

  • Assignee:
    Unassigned
    Reporter:
    Uwe Kubosch
Vote (0)
Watch (1)

Dates

  • Created:
    28/Apr/09 5:12 PM
    Updated:
    27/Oct/09 1:49 PM
    Resolved:
    01/Oct/09 2:48 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.