[Nitro] Trying Og example
George Moschovitis
george.moschovitis at gmail.com
Wed Aug 17 14:44:32 EDT 2005
Hello Brian,
sorry for the late reply, I was camping on a mountain w/o
net/telephone access :-)
MySQL is well supported in Og. Mysql just needs a maximum length on blob keys.
To make the example work just change the following line:
property :name, String, :unique => true
to
property :name, String, :uniq => true
:uniq (unlike :unique) does not force a unique constrain (ie key) on
the generated table.
Thanks for pointing this out though, I 'll improve the examle and mysql code.
-g.
On 8/15/05, Brian Candler <B.Candler at pobox.com> wrote:
> I'm just trying out og-0.22.0 starting with examples/run.rb. I have mysql
> rather than psql installed, so I made what seems to be the obvious change:
>
> --- run.rb~ Mon Aug 15 21:10:41 2005
> +++ run.rb Mon Aug 15 21:10:41 2005
> @@ -136,10 +136,10 @@
>
> config = {
> :destroy => true, # destroy table created from earlier runs.
> - :store => 'psql',
> + :store => 'mysql',
> :name => 'test',
> - :user => "postgres",
> - :password => "navelrulez"
> + :user => "root",
> + :password => ""
> }
>
> # Initialize Og
>
>
> Running it gives the following output:
>
> Database "test" dropped
> INFO: Database 'test' not found!
> DEBUG: Og manageable classes: [Part, UserComment, ArticleComment, Category, Article, User, Comment]
> INFO: Created table 'ogpart'.
> INFO: Created table 'ogusercomment'.
> INFO: Created table 'ogarticlecomment'.
> INFO: Created table 'ogcategory'.
> INFO: Created table 'ogarticle'.
> DEBUG: Join table already exists
> /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:453:in `read': BLOB/TEXT column 'name' used in key specification without a key length (Mysql::Error)
> from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:345:in `read_query_result'
> from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:160:in `real_query'
> from /v/build/nitro/ruby-mysql-0.2.6/mysql.rb:275:in `query'
> from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:215:in `create_table'
> from (eval):5:in `send'
> from (eval):5:in `og_create_schema'
> from /v/build/nitro/og-0.22.0/lib/og/store/sql.rb:290:in `enchant'
> from /v/build/nitro/og-0.22.0/lib/og/store/mysql.rb:138:in `enchant'
> from /v/build/nitro/og-0.22.0/lib/og/manager.rb:128:in `manage'
> from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes'
> from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `each'
> from /v/build/nitro/og-0.22.0/lib/og/manager.rb:183:in `manage_classes'
> from /v/build/nitro/og-0.22.0/lib/og.rb:157:in `setup'
> from run.rb:147
>
> I'm running ruby-mysql-0.2.6 and mysql 4.1.11. Any suggestions where to
> look to fix this? Or is mysql not well supported by Og?
>
> Thanks,
>
> Brian.
> _______________________________________________
> 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