Damien Lepage schrieb:
> I would like to know if there is an easy way to automatically create 
> views each time I rebuild my database.
> In other words, is there a place where I can put a custom script which 
> will create my views and will be triggered when my database is built (by 
> doctrine:build-db I think).
> 
> I read about using Views with Doctrine here:
> http://www.doctrine-project.org/documentation/manual/1_0/en/component-overview:views
> But I miss information about how to integrate views when using doctrine 
> in symfony.

I can only tell how I did it for Propel but I suppose it will work for 
Doctrine, too: just put the SQL to generate your view into something 
like /data/sql/my_view.sql and it will automatically be included during 
DB build/create execution.
If there's a folder /data/sql/doctrine (can't find out atm) then that's 
your place of course.

Just make sure your view code gets executed after all the other SQL 
statements (so all tables exist). Symfony will order the SQL files by 
name, so you can use the file name to change the order.

Hope that helps

David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to