[Nitro] sqlite errors

George Moschovitis george.moschovitis at gmail.com
Tue Nov 29 03:07:51 EST 2005


yeah,

add:

class A
  belongs_to B
  ...
end


On 11/28/05, itsme213 <itsme213 at hotmail.com> wrote:
> I get errors using sqlite with og 0.25. Am I doing something wrong?
>
> Thanks!
>
> ---------------
>
> require 'og'
>
> class A
>  property :name, String
>  def initialize(n)
>   @name = n
>  end
> end
>
> class B
>  property :name, String
>  has_many :posts, A
> end
>
> Og.setup(
>  :store => :sqlite
> )
>
> b = B.new
> a1 = A.new "a1"
> a2 = A.new "a2"
>
> b.posts << a1
> b.posts << a2
>
> b.posts.each {|a| puts a.name}
>
> b.save
> a1.save
> a2.save
>
> b.posts.each {|a| puts a.name}
>
>
> -------------------------
> C:> a1
> a2
> I, [2005-11-28T11:27:10.419000 #2916]  INFO -- : Created table 'ogb'.
> I, [2005-11-28T11:27:10.519000 #2916]  INFO -- : Created table 'oga'.
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/errors.rb:94:in
> `check': no such column: b_oid (SQLite3::SQLException)
>  from
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/statement.rb:70:in
> `initialize'
>  from
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in
> `new'
>  from
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:183:in
> `prepare'
>  from
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:274:in
> `query'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/store/sqlite.rb:82:in
> `query'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/store/sql.rb:416:in
> `find'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/entity.rb:121:in
> `find'
>  from (eval):43:in `find_posts'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/collection.rb:73:in
> `send'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/collection.rb:73:in
> `load_members'
>  from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/collection.rb:104:in
> `each'
>  from C:/og_each.rb:36
> Process ruby exited with code 1
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>


--
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list