-
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.
fix: alteração em docker-compose para criação de intancia com banco d…
…e dados Estava ocorrendo um erro de conexão pois o Nhibernate no Progra.cs procurava uma conexão com o banco MercadoLivreClone. Porém, o BD ainda não existia. A solução foi criar o BD pelo Docker conforme a sugestão em: microsoft/mssql-docker#2 (comment)
- Loading branch information
1 parent
97653f4
commit ebf841f
Showing
7 changed files
with
35 additions
and
6 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
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,6 @@ | ||
#wait for the SQL Server to come up | ||
sleep 30s | ||
|
||
echo "running set up script" | ||
#run the setup script to create the DB and the schema in the DB | ||
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P P@ssword42 -d master -i db-init.sql |
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,11 @@ | ||
USE [master] | ||
GO | ||
|
||
IF DB_ID('MercadoLivreClone') IS NOT NULL | ||
set noexec on -- prevent creation when already exists | ||
|
||
CREATE DATABASE [MercadoLivreClone]; | ||
GO | ||
|
||
USE [MercadoLivre] | ||
GO |
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,2 @@ | ||
#start SQL Server, start the script to create/setup the DB | ||
/db-init.sh & /opt/mssql/bin/sqlservr |
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