# Creating a view through a migration

**URL:** <https://www.ruby-forum.com/t/creating-a-view-through-a-migration/173858>\
**Category:** Rails\
**Created:** [August 17, 2009, 5:13am UTC](https://www.ruby-forum.com/t/creating-a-view-through-a-migration/173858 "2009-08-17T05:13:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [August 17, 2009, 5:13am UTC](https://www.ruby-forum.com/t/creating-a-view-through-a-migration/173858/1 "2009-08-17T05:13:46Z")

</div>

Does anyone have any experience creating views using migration files. I  
know that I could create the view using execute syntax but I was  
wondering  
if there is a best practice with regards to that?

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![chero](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e99b99/32.png) [@chero](https://www.ruby-forum.com/u/chero)\
**Post date:** [August 17, 2009, 6:49am UTC](https://www.ruby-forum.com/t/creating-a-view-through-a-migration/173858/2 "2009-08-17T06:49:15Z")

</div>

James E. wrote:

> Does anyone have any experience creating views using migration files.

The rails\_sql\_views gem should handle that for you, or so say the docs  
(I’ve never used it).

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
