Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2009-03-10 Thread Ola Bini
taobot wrote: Hi Ola, I may have an example of where it would be desirable to have a default of 255 rather that allowing the server's maximum varchar length to be used. I'm using the current out-of-the-box activerecord-jdbc along with a Sybase ASE server over JTDS. Running rake db:migrate in

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2009-03-09 Thread taobot
Hi Ola, I may have an example of where it would be desirable to have a default of 255 rather that allowing the server's maximum varchar length to be used. I'm using the current out-of-the-box activerecord-jdbc along with a Sybase ASE server over JTDS. Running rake db:migrate in my rails app sta

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-12 Thread Ola Bini
Clint Hill wrote: I have no strong reason for defaulting to 255 other than the model in question has around 20 attributes that are strings (name, agency, policy, etc) and I didn't feel adding the ":limit => 255" to the migration for each and every column was a good idea. I don't have to for My

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-12 Thread Clint Hill
I have no strong reason for defaulting to 255 other than the model in question has around 20 attributes that are strings (name, agency, policy, etc) and I didn't feel adding the ":limit => 255" to the migration for each and every column was a good idea. I don't have to for MySQL, SQLite etc

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-12 Thread Ola Bini
Clint Hill wrote: If I choose to limit the size to 255 as a default - is the proper place to do that in the modify_types method call like so? def modify_types(tp) tp[:primary_key] = "NUMBER(38) NOT NULL PRIMARY KEY" tp[:integer] = { :name => "NUMBER", :limit => 38 } tp[:dat

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-12 Thread Clint Hill
If I choose to limit the size to 255 as a default - is the proper place to do that in the modify_types method call like so? def modify_types(tp) tp[:primary_key] = "NUMBER(38) NOT NULL PRIMARY KEY" tp[:integer] = { :name => "NUMBER", :limit => 38 } tp[:datetime] = { :name =

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-11 Thread Ola Bini
Clint Hill wrote: Yes - the create statement includes VARCHAR2(4000). As Ola points out (which I was afraid of) the adapter will default to the biggest size allowed. Interestingly only the Oracle implementation in activerecord-jdbc-adapter does this. Most others choose 255 as the default. T

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-11 Thread Clint Hill
Yes - the create statement includes VARCHAR2(4000). As Ola points out (which I was afraid of) the adapter will default to the biggest size allowed. Interestingly only the Oracle implementation in activerecord-jdbc-adapter does this. Most others choose 255 as the default. Thanks for the in

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-11 Thread Ola Bini
Nick Sieger wrote: I don't think activerecord-jdbc has anything to do with default sizes, they should be baked into AR's migrations. Is the SQL sent to the database actually specifying varchar2(4000)? Yes, the default sizes are in the adapters. The general default for strings in adapters is

Re: [jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-11 Thread Nick Sieger
I don't think activerecord-jdbc has anything to do with default sizes, they should be baked into AR's migrations. Is the SQL sent to the database actually specifying varchar2(4000)? /Nick On Thu, Dec 11, 2008 at 8:20 AM, Clint Hill <[EMAIL PROTECTED]> wrote: > I'm not sure if this is the best pla

[jruby-dev] ActiveRecord JDBC Oracle string default question

2008-12-11 Thread Clint Hill
I'm not sure if this is the best place for this question (so redirect if not) but I was wondering about the String default from the activerecord-jdbc-adapter. When using Oracle the default for string seems odd. create_table :accounts do |t| t.string :name end This will create a colu