Damien Lepage wrote: > Thanks for your help David. > However, it seems to be different for doctrine. I tried it and it doesn't > work. > > The help for *propel:insert-sql* says: > The task connects to the database and executes all SQL statements found in > [config/sql/*schema.sql|COMMENT] files. > > But the help for *doctrine:insert-sql* says: > The task connects to the database and creates tables for all the > lib/model/doctrine/*.php files. > > Anybody knows how to execute custom SQL script with Doctrine ?
Why not just put this in a shell script and call it from the command line? That's really all that the above mentioned propel or doctrine commands do. It would take you, what, 5 minutes to write your own script? --- lawrence > > > > 2009/2/17 David Herrmann <d...@okto.tv> > >> 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 -~----------~----~----~----~------~----~------~--~---