@echo off SET DIR=%~d0%~p0% SET database.name="DEV_AcademyCore" SET sql.files.directory=%DIR%..\ SET server.database="MSSQLSERVER2008" SET repository.path="https://svn/DatabaseSchema" SET version.file="_BuildInfo.xml" SET version.xpath="//buildInfo/version" SET environment="LOCAL" SET folder.dbcreate=%sql.files.directory%0001_CreateDatabase\custom_db_create.sql SET folder.dbalterfolder=%sql.files.directory%0002_AlterDatabase\ SET folder.runaftercreate=%sql.files.directory%0003_RunOnceAfterCreate\ SET folder.upfolder=%sql.files.directory%0004_RunOnceUpdates\ SET folder.runfirst=%sql.files.directory%0005_RunFirstAfterUpdate\ SET folder.functions=%sql.files.directory%0006_Functions\ SET folder.views=%sql.files.directory%0007_Views\ SET folder.sprocs=%sql.files.directory%0008_StoredProcedures\ SET folder.runafteranyother=%sql.files.directory%0009_RunAnytime\ SET folder.permissions=%sql.files.directory%0010_PermissionRunEverytime\ rem - the drop "%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%
/createdatabasescript=%folder.dbcreate%
/upfolder=%folder.upfolder%
/runfirstfolder=%folder.runfirst%
/functionsfolder=%folder.functions%
/viewsfolder=%folder.views%
/sprocfolder=%folder.sprocs%
/runAfterOtherAnyTimeScripts=%folder.runafteranyother%
/permissionsfolder=%folder.permissions%
/alterdatabasefolder=%folder.dbalterfolder%
/runaftercreatedatabasefolder=%folder.runaftercreate%
/drop
rem - recreate
"%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%
/createdatabasescript=%folder.dbcreate%
/upfolder=%folder.upfolder%
/runfirstfolder=%folder.runfirst%
/functionsfolder=%folder.functions%
/viewsfolder=%folder.views%
/sprocfolder=%folder.sprocs%
/runAfterOtherAnyTimeScripts=%folder.runafteranyother%
/permissionsfolder=%folder.permissions%
/alterdatabasefolder=%folder.dbalterfolder%
/runaftercreatedatabasefolder=%folder.runaftercreate%
/simple
SET folder.dbalterfolder=%sql.files.directory%0002_AlterDatabase\
SET folder.dbalterfolder=0002_AlterDatabase
--
You received this message because you are subscribed to the Google Groups "chucknorris" group.
To view this discussion on the web visit https://groups.google.com/d/msg/chucknorrisframework/-/FUJoowjCfhoJ.
To post to this group, send email to chucknorri...@googlegroups.com.
To unsubscribe from this group, send email to chucknorrisframe...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chucknorrisframework?hl=en.
Hi Rob
I've finally gotten around to cleaning up the foldernames, etc that you highlighted earlier but I am still getting the same issue as before: the scripts in the "runaftercreatedatabasefolder" do no appear to be run by the rh.exe.
Here's the batchfile now as it stands:
@echo off
CLS
SET DIR=%~d0%~p0%
SET folder.outputPath=%DIR%..\_migrations\
SET db.serverInstance=MSSQLSERVER2008
SET db.name=DEV_Test
SET db.admin.connectString="Password=c1rrus2013;User ID=rhDeployUser;Initial Catalog=master;Data Source=%db.serverInstance%;Packet Size=4096"
SET db.create.script=%DIR%..\0001_CreateDatabase\cirrus_db_create.sql
SET repository.path=https://localhost/DatabaseSchema
SET version.file=_BuildInfo.xml
SET version.xpath=//buildInfo/version
SET rh.environment=LOCAL
SET folder.scripts.base=%DIR%..\
SET folder.scripts.dbalterfolder=0002_AlterDatabase
SET folder.scripts.runaftercreate=0003_RunOnceAfterCreate
SET folder.scripts.upfolder=0004_RunOnceUpdates
SET folder.scripts.runfirst=0005_RunFirstAfterUpdate
SET folder.scripts.functions=0006_Functions
SET folder.scripts.views=0007_Views
SET folder.scripts.sprocs=0008_StoredProcedures
SET folder.scripts.runafteranyother=0009_RunAnytime
SET folder.scripts.permissions=0010_PermissionRunEverytime
REM --- the drop
"%DIR%Console\rh.exe" /output=%folder.outputPath% /d=%db.name% /s=%db.serverInstance% /f=%folder.scripts.base% /drop
REM --- the create
"%DIR%Console\rh.exe" /connstringadmin=%db.admin.connectString% /output=%folder.outputPath% /d=%db.name% /s=%db.serverInstance% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%rh.environment% /f=%folder.scripts.base% /createdatabasescript=%db.create.script% /upfolder=%folder.scripts.upfolder% /runfirstfolder=%folder.scripts.runfirst% /functionsfolder=%folder.scripts.functions% /viewsfolder=%folder.scripts.views% /sprocfolder=%folder.scripts.sprocs% /runAfterOtherAnyTimeScripts=%folder.scripts.runafteranyother% /permissionsfolder=%folder.scripts.permissions% /alterdatabasefolder=%folder.scripts.dbalterfolder% /runaftercreatedatabasefolder=%folder.scripts.runaftercreate% /simple
I've attached the change.log that was generated when I last ran the bat file. You'll see that rh appears to look at the ..\0002_AlterDatabase folder, then the ..\0004_RunOnceUpdates, skipping the 0003_RunOnceAfterCreate folder. The error that you see logged near the end is because the tblChain object gets created by a script that is in the 0003 folder.
Clarification: for the drop, I tried using a full connection string with the /cs switch however rh.exe would give me back a message that it required a database name for the /d switch or a connection for the /cs switchs. The doco says that both those switches are required, however you implied that I just needed the connectionstring and the /drop but I'm not sure that rh.exe is working that way. I CAN get rh to work using the database name/server name combination.
Thanking you muchly for your help - I'm a bit of a noob with this :S
Tim
To unsubscribe from this group, send email to chucknorrisframework+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/chucknorrisframework/-/WTiFHISg-WwJ.
To unsubscribe from this group, send email to chucknorrisframe...@googlegroups.com.
Hi Rob
I've finally gotten around to cleaning up the foldernames, etc that you highlighted earlier but I am still getting the same issue as before: the scripts in the "runaftercreatedatabasefolder" do no appear to be run by the rh.exe.
Here's the batchfile now as it stands:
@echo off
CLS
SET DIR=%~d0%~p0%
SET folder.outputPath=%DIR%..\_migrations\
SET db.serverInstance=MSSQLSERVER2008
SET db.name=DEV_Test
To view this discussion on the web visit https://groups.google.com/d/msg/chucknorrisframework/-/WTiFHISg-WwJ.
To unsubscribe from this group, send email to chucknorrisframe...@googlegroups.com.