Review Board 1.0.8

In database, the column "grade_entry_items.out_of" should be a float

Updated 5 months ago

Bryan Shen Reviewers
markus_developers
None MarkUs Source Code Repository
When Markus is hosted with Postgres, an instructor was not able to open the grade entries view because the the out_of was a string in database.
Manual
Posted 5 months, 1 week ago (February 22nd, 2010, 12:47 p.m.)

   

  
Hm.  At least for me on Sqlite3, this throws the following error:

SQLite3::SQLException: Cannot add a NOT NULL column with default value NULL: ALTER TABLE "grade_entry_items" ADD "out_of" float NOT NULL

I think you'll either need to provide a default value (0.0, for example), or let NULL be allowed.

I've been bitten a few times by default values written into the database...I'd go with the latter, and let NULLs in - ActiveRecord will ensure that no NULLs are entered with validates_presence_of.

I'm open to argument on this.
  1. Thanks for finding this out. I agree that we remove ":null => false", since the presence of ":out_of" is validated in the GradeEntryItem model
Review request changed
Updated 5 months ago (February 24th, 2010, 3:07 a.m.)
Ship it!
Posted 5 months ago (February 24th, 2010, 9:35 a.m.)
Bryan:

Looks good to me!  Ship!

-Mike