Create views with Rails

25 views
Skip to first unread message

André Lima

unread,
May 10, 2013, 5:04:18 PM5/10/13
to oracle-...@googlegroups.com
Friends,

Is possible create a view using migrations as well as create tables?

Thanks

Andre Lima

Raimonds Simanovskis

unread,
May 11, 2013, 6:02:00 AM5/11/13
to oracle-...@googlegroups.com
I wouldn't recommend to use migrations to create database views. As you might want to change view definition from time to time and as it does not cause any database schema changes it is better to store just the latest view definitions in some files in your repository and then create additional rake task which could be used to install latest view definitions.

You can also take a look at database_loader gem (https://github.com/ebeigarts/database_loader) by one of oracle_enahnced maintainers Edgars which provides default structure and rake tasks for loading views, materialized views and other additional database objects.

Kind regards,
Raimonds
Reply all
Reply to author
Forward
0 new messages