-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create database custom script to handle file path - chucknorris/round…
…house#17 - thanks Seif!
- Loading branch information
ferventcoder
committed
Sep 22, 2011
1 parent
4021250
commit 10307ad
Showing
12 changed files
with
58 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
USE master | ||
IF NOT EXISTS(SELECT * FROM sys.databases WHERE [name] = '{{DatabaseName}}') | ||
BEGIN | ||
CREATE DATABASE {{DatabaseName}} | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@echo off | ||
|
||
SET DIR=%~d0%~p0% | ||
|
||
SET database.name="${database.name}" | ||
SET sql.files.directory="%DIR%${dirs.db}\SQLServer\${database.name}" | ||
SET server.database="${server.database}" | ||
SET repository.path="${repository.path}" | ||
SET version.file="${file.version}" | ||
SET version.xpath="//buildInfo/version" | ||
SET environment=${environment} | ||
SET custom.create.script="USE master;IF NOT EXISTS(SELECT * FROM sys.databases WHERE [name] = '{{DatabaseName}}')BEGIN; CREATE DATABASE {{DatabaseName}}; END;" | ||
|
||
"%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% /drop | ||
"%DIR%Console\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /cds=%custom.create.script% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% /simple |
14 changes: 14 additions & 0 deletions
14
deployment/templates/DBDeployment.DropCustomFileCreate.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo off | ||
|
||
SET DIR=%~d0%~p0% | ||
|
||
SET database.name="${database.name}" | ||
SET sql.files.directory="%DIR%${dirs.db}\SQLServer\${database.name}" | ||
SET server.database="${server.database}" | ||
SET repository.path="${repository.path}" | ||
SET version.file="${file.version}" | ||
SET version.xpath="//buildInfo/version" | ||
SET environment=${environment} | ||
|
||
"%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% /drop | ||
"%DIR%Console\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /cds=%sql.files.directory%\custom_db_create.sql /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% /simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters