- RabbitMQ
- PostgreSQL
- Seq
- Jaeger
- Set AWS Keys
set AWS_ACCESS_KEY_ID =hello
set AWS_SECRET_ACCESS_KEY =hello
set AWS_REGION=us-east-1
Powershell Commands
dotnet tool update --global dotnet-ef --version 6.0.1
$Env:AWS_ACCESS_KEY_ID = "hello"
$Env:AWS_SECRET_ACCESS_KEY = "hello"
$Env:AWS_REGION = "us-east-1"
dotnet ef database update --project src\Infrastructure\ChurchManager.Infrastructure.Persistence\ChurchManager.Infrastructure.Persistence.csproj --startup-project src\API\ChurchManager.Api\ChurchManager.Api.csproj --context ChurchManager.Infrastructure.Persistence.Contexts.ChurchManagerDbContext
- Run all the docker commands in the
docker containers
file in the root directory.
docker compose -f docker-compose.dependencies.yml up
Migrations Visual Studio
-
In
Package manager console
change toChurchManager.Infrastructure.Persistence
project -
Add-Migration InitialDbMigration -Context ChurchManagerDbContext -o Migrations -StartupProject ChurchManager.Api
-
Update-Database -Context ChurchManagerDbContext -StartupProject ChurchManager.Api
Migrations Powershell/Rider
- cd into
Persistence
directorycd src\Infrastructure\ChurchManager.Infrastructure.Persistence
-
dotnet ef migrations add LinkFamilyToPerson -c ChurchManagerDbContext -o Migrations -s ..\..\API\ChurchManager.Api\ChurchManager.Api.csproj
- cd back to root:
cd ../../..
dotnet ef database update --project src\Infrastructure\ChurchManager.Infrastructure.Persistence\ChurchManager.Infrastructure.Persistence.csproj --startup-project src\API\ChurchManager.Api\ChurchManager.Api.csproj --context ChurchManager.Infrastructure.Persistence.Contexts.ChurchManagerDbContext
Cannot delete because connections are not closed
- in the docker container execute: `psql -U admin`
- `SELECT * FROM pg_stat_activity WHERE pg_stat_activity.datname='churchmanager_db';` shows open connections
- `SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'churchmanager_db';` close open connections
- `DROP DATABASE churchmanager_db;`
Unable to create a 'DbContext' of type 'ChurchManagerDbContext'
- check that the environment variables are set as per step 1
- logs should have values here and not empty:
AWS_ACCESS_KEY_ID : [] AWS_REGION : []
Most settings for production e.g. database connection will come from AWS Parameter store
.
AWS Cognito IDP
https://cognito-idp.us-east-1.amazonaws.com/us-east-1_i6pWJxu8q/.well-known/openid-configuration
set AWS_DEFAULT_PROFILE=personal
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 977844596384.dkr.ecr.us-east-1.amazonaws.com
- Create ECR Respository
aws ecr create-repository --repository-name frontend-angular --image-scanning-configuration scanOnPush=true --image-tag-mutability IMMUTABLE --region us-east-1 --profile personal
- Build the docker image
- Tag the docker image
docker tag church-manager-ui:latest 977844596384.dkr.ecr.us-east-1.amazonaws.com/frontend-angular:local
- Push the image
docker push 977844596384.dkr.ecr.us-east-1.amazonaws.com/frontend-angular:local
https://postgresblog.blogspot.com/
install 32bit driver Create ODBC DSN In ReportBuilder from Microsoft: set
Connection String
Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;Database=churchmanager_db;Schema=public;Uid=postgres;Pwd=*****;