Sqlite3 & NULL == chaos?

Hi there!,

I did some research regarding my post:

http://lists.radiantcms.org/pipermail/radiant/2007-June/005165.html

In summary the problem is that i get an exception in

app/views/admin/page/edit.rhtml when calling
“filter_reference(default_filter_name)”:

---- 8< ----

<%= default_filter_name %> Reference

<%= filter_reference(default_filter_name) %>

<%= link_to_function 'Close', "Element.hide('filter-reference-popup')", :class => 'close-link' %>

---- 8< ----
 After some debugging i found that in my sqlite3 database, fields

of type “string” have a weird default value in the schema, and not a
default NULL value. This is for all tables.

For example this is the schema for the table "page_parts" reported

by sqlite3:

CREATE TABLE page_parts (“id” INTEGER PRIMARY KEY NOT NULL, “name”
varchar(100) DEFAULT ‘’‘NULL’’’, “filter_id” varchar(25) DEFAULT
‘’‘NULL’’’, “content” text DEFAULT ‘’‘NULL’’’, “page_id” integer
DEFAULT 0);

The default value is the string “‘NULL’” or whatever, but not the
raw NULL value. I have verified this in the rails console and with
rdebug.

This is what is causing me problems + other strange behaviors.

Did someone have this problem with sqlite3? It’s a problem of my
sqlite3 bindings?

/AITOR

On 6/11/07, Aitor Garay-Romero [email protected] wrote:

 After some debugging i found that in my sqlite3 database, fields

of type “string” have a weird default value in the schema, and not a
default NULL value. This is for all tables.

Read this first:
http://weblog.rubyonrails.com/2007/1/29/using-sqlite3-with-rails

Thanks for the info, now it’s working. I updated my debian system
to get the latest sqlite3 and the installation instructions at
http://dev.radiantcms.org/radiant/wiki/Installation .

The “db:bootstrap” is still not creating the admin user though.
“script/console” is also failing, i will comment this in a separate
thread.

/AITOR

The “db:bootstrap” is still not creating the admin user though.

I was wrong.  It's working correctly on my system.

/AITOR

“script/console” is also failing, i will comment this in a separate
thread.

I discovered that this was solved on revision 448
(http://dev.radiantcms.org/radiant/changeset/448).

/AITOR

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs