How can I drop a database before creating it in a Roundhouse Script

59 views
Skip to first unread message

Christopher Asaipilai

unread,
Jan 20, 2015, 10:30:00 AM1/20/15
to chucknorri...@googlegroups.com
Hi there

I am testing a batch file using Roundhouse which is running through a set of creation scripts for a database.

Because I am repeatedly testing it, to see that the scripts pass, I have to drop the database manually in SQL Server Management Studio

Is there a way that I can issue a drop command before the creation.

Below is the bat file extract that I am using:

@echo off
SET DIR=%~d0%~p0%

echo %DIR%
SET database.name="NewPricingTool"
SET sql.files.directory="%DIR%RestoreScripts"

echo %sql.files.directory%
SET server.database="(local)"
SET repository.path="https://github.com/chucknorris/roundhouse.git"
SET version.file="_BuildInfo.xml"
SET version.xpath="//buildInfo/version"
SET environment="LOCAL"
"%DIR%Console\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% /simple
pause

Rob Reynolds

unread,
Jan 20, 2015, 12:13:05 PM1/20/15
to chucknorri...@googlegroups.com
For testing only 

rh /d=%database.name%  /s=%server.database% /drop

just before your call to create it.

However if you are running this locally all the time and using visual studio, you should really look at https://www.nuget.org/packages/roundhouse.refreshdatabase.fnh/ or https://www.nuget.org/packages/roundhouse.refreshdatabase.ef/.

Of course those both use a migrations framework, we need another that doesn't attempt to implement anything special to generate sql files.


--
You received this message because you are subscribed to the Google Groups "chucknorris" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chucknorrisframe...@googlegroups.com.
To post to this group, send email to chucknorri...@googlegroups.com.
Visit this group at http://groups.google.com/group/chucknorrisframework.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages