views:

184

answers:

2

I have created the following table in sqlite3:

CREATE TABLE Test ( Id TEXT PRIMARY KEY NOT NULL, Count REAL );

But when I try to generate a model for this table, the schema.rb gives the following error:

Could not dump table "Test" because of following StandardError: Unknown type 'REAL' for column 'Count'

Is there another datatype I can use instead of real that will work with rails?

A: 

Have you tried using Rails' inbuilt migrations to build your table?

Mr. Matt
I'm using "ruby script\generate scaffold Test" in this case. Still fails.
A: 

Yes, use rake db:migrate

Also, for a count field, simply use an integer datatype instead of a float or REAL.

Sev
Count was a bad name though, I just used that for a test.Turns out that Rails handles FLOAT just fine, it just doesn't seem to parse REAL.
Glad you got it sorted.
Sev