bitrot cleared, runs on dantalion

This commit is contained in:
adam 2024-12-26 16:34:17 -05:00
parent 1b8a714a96
commit a7afcacee8
2 changed files with 32 additions and 1 deletions

31
devuitls.sh Executable file
View File

@ -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

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<NoWarn>$(NoWarn);CA2254</NoWarn> <NoWarn>$(NoWarn);CA2254</NoWarn>
</PropertyGroup> </PropertyGroup>