From a7afcacee84c88298cd3d7c63f1bf34dd9828f54 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 26 Dec 2024 16:34:17 -0500 Subject: [PATCH] bitrot cleared, runs on dantalion --- devuitls.sh | 31 +++++++++++++++++++++++++++++++ vassago.csproj | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 devuitls.sh diff --git a/devuitls.sh b/devuitls.sh new file mode 100755 index 0000000..0445b36 --- /dev/null +++ b/devuitls.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +servicename="vassago" +pw_developmentdatabase="wnmhOttjA0wCiR9hVoG7jjrf90SxWvAV" +connnectionstr="Host=localhost;Database=${servicename}_dev;Username=${servicename};Password=${pw_developmentdatabase};IncludeErrorDetail=true;" + +case "$1" in + "initial") + sudo -u postgres psql -c "create database ${servicename}_dev;" + sudo -u postgres psql -c "create user $servicename with encrypted password '$pw_developmentdatabase';" + sudo -u postgres psql -c "grant all privileges on database ${servicename}_dev to $servicename;" + sudo -u postgres psql -d "${servicename}_dev" -c "GRANT ALL ON SCHEMA public TO $servicename" + + cp appsettings.sample.json appsettings.json + dotnet ef database update --connection "$connnectionstr" + ;; + + "add-migration") + dotnet ef migrations add "$2" + dotnet ef database update --connection "$connnectionstr" + ;; + + "dbupdate") + dotnet ef database update --connection "$connnectionstr" + ;; + + *) + echo "Unknown command '$1', try 'initial'" + ;; +esac + diff --git a/vassago.csproj b/vassago.csproj index f9392a8..dae7d44 100644 --- a/vassago.csproj +++ b/vassago.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable $(NoWarn);CA2254