File tree Expand file tree Collapse file tree 1 file changed +36
-2
lines changed
Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,45 @@ Services communicate asynchronously via RabbitMQ message queues. See the Message
4949
5050## Database Deployment (Test Environments)
5151
52+ If you are deploying to test DROP existing databases before continuing.
53+
54+ ````sql
55+ DECLARE @Databases TABLE (DbName sysname);
56+
57+ INSERT INTO @Databases (DbName)
58+ VALUES
59+ ('ClusterDb'),
60+ ('DeliusRunningPictureDb'),
61+ ('DeliusStagingDb'),
62+ ('MatchingDb'),
63+ ('OfflocRunningPictureDb'),
64+ ('OfflocStagingDb'),
65+ ('AuditDb');
66+
67+ DECLARE @sql nvarchar(max) = N'';
68+
69+ SELECT @sql += '
70+ IF EXISTS (SELECT 1 FROM sys.databases WHERE name = ''' + DbName + ''')
71+ BEGIN
72+ ALTER DATABASE [' + DbName + '] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
73+ DROP DATABASE [' + DbName + '];
74+ END;'
75+ FROM @Databases;
76+
77+ EXEC sys.sp_executesql @sql;
78+ ````
79+
5280The `publish_db.py` script is provided for deploying database projects to test environments.
5381
5482### Prerequisites
55- - Python 3
56- - .NET SDK with sqlpackage tool installed
83+
84+ | Requirement | How to check | How to install (bash) |
85+ |------------|-------------|------------------------|
86+ | **Python 3** | `python3 --version` | **macOS (Homebrew)**<br>`brew install python`<br><br>**Ubuntu / Debian**<br>`sudo apt update && sudo apt install -y python3 python3-pip` |
87+ | **.NET SDK 8.x** | `dotnet --list-sdks` | **macOS (Homebrew)**<br>`brew install --cask dotnet-sdk@8`<br><br>**Ubuntu / Debian**<br>`sudo apt update && sudo apt install -y dotnet-sdk-8.0` |
88+ | **.NET SDK 10.x** | `dotnet --list-sdks` | **macOS (Homebrew)**<br>`brew install --cask dotnet-sdk@10`<br><br>**Ubuntu / Debian**<br>`sudo apt update && sudo apt install -y dotnet-sdk-10.0` |
89+ | **sqlpackage (dotnet tool)** | `dotnet tool list -g` | `dotnet tool install -g microsoft.sqlpackage` |
90+
5791
5892### Usage
59931 . **Set required environment variables** before running:
You can’t perform that action at this time.
0 commit comments