Hi John,
Sorry about our late reply. We have tested the migration below with
activerecord (jruby + jdbc adapter) and it worked fine. It's safe to
use boolean for 'trusted' attribute.
class HostTables < ActiveRecord::Migration
def self.up
create_table :hosts do |t|
t.string :ip
t.boolean :trusted <--- boolean (instead of string)
t.string :tfrom
t.string :tto
end
end
def self.down
drop_table :hosts
end
end
Oracle "desc hosts" command shows:
SQL> desc hosts;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NOT NULL NUMBER(38)
IP VARCHAR2(4000)
TRUSTED NUMBER(1)
TFROM VARCHAR2(4000)
TTO
I renamed attributes "from" and "to" because they seem to make oracle complain:
ActiveRecord::ActiveRecordError: ORA-00904: : identificador no válido
(ActiveRecord::StatementInvalid)
I plan to test this with ruby-oci8 interface. I had some problems
compiling that gem... :(
Best regards.
//Gonzalo
2009/4/16 Gonzalo Suarez <[email protected]>:
> Hi John,
>
> We haven't set our oracle database server yet. As soon as we can get
> it up and running will test some activerecord stuff against it. Next
> week we'll get back to you on this particular issue.
>
> Thanks.
> Best regards,
>
> Gonzalo
>
>
>
>
>
> 2009/4/14 John Mettraux <[email protected]>:
>>
>> On Tue, Apr 14, 2009 at 8:07 PM, Gonzalo Suarez
>> <[email protected]> wrote:
>>>
>>> Sorry, our data typing for hosts is a little bit lazy... As for now,
>>> 'to' and 'from' attributes could certainly be set to integer although
>>> this time of date check may get improved so it could be specified
>>> something like "Mondays to Thursdays from 8h to 19h, Fridays from 8h
>>> to 15h".
>>
>> Hello Gonzalo,
>>
>> understood.
>>
>>> However, "trusted" attribute was set to string because we aren't sure
>>> how well activerecord and oracle would work with boolean datatype.
>>> (oracle doesn't support booleans) Feel free to change this datatypes
>>
>> Could you do a quick test with a dummy rails app and a dummy migration /
>> model ?
>>
>> I have the impression that ActiveRecord might do the mapping for us
>> (http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&q=activerecord+oracle+boolean).
>>
>> Thanks in advance,
>>
>> --
>> John Mettraux - http://jmettraux.wordpress.com
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---