db_leftovers gets CHECK constraints

2012-09-27 , ,

I added CHECK constraints to my db_leftovers gem. This mean you can say things like this:

table :books do
  check :book_has_pages, 'pages_count > 0'
end

Even though the Rails team doesn’t like foreign keys or other constraints, I think it’s wise to guard against developer error and ensure that bugs cause failure sooner rather than later, with no data corruption. So I’m glad to announce that db_leftovers now supports not just foreign keys, but also CHECK constraints.

blog comments powered by Disqus Prev: EVAL in Redis Next: Rails has_many :through with Checkboxes