bellotastudios/gradecraft-development — pull request #548 by allspiritseve (2013-10-15 14:15:59+00:00)
Title: Add rake tasks to manage SQL views

@bigeasy would appreciate some feedback on this. I realized while adding some SQL views to Townstage that I wanted to be able to frequently update views, which didn't really fit with the Rails migration workflow. I wrote some rake tasks to help with the process:

```shell
rake db:views:load
rake db:views:drop
rake db:views:reload
```

Views are stored in db/views/*.sql. When you add a view, add a line to `lib/tasks/db/views.rake` in the `load` task and the `drop` task referencing that view.

I originally wrote it so the rake task just looped through db/views and executed each file, but I have one view that is dependent on another view, so I think it makes sense to order them.

Let me know if you like this approach or if you'd prefer we handle it another way.