forked from adam/discord-bot-shtik
seems to work on balaam
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
This commit is contained in:
parent
0d0d377a05
commit
37d3ec5947
25
devuitls.sh
Executable file
25
devuitls.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
servicename="vassago"
|
||||||
|
pw_developmentdatabase="wnmhOttjA0wCiR9hVoG7jjrf90SxWvAV"
|
||||||
|
connnectionstr="Host=localhost;Database=${servicename}_dev;Username=${servicename};Password=${pw_developmentdatabase};IncludeErrorDetail=true;"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"dbinit")
|
||||||
|
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"
|
||||||
|
|
||||||
|
#dotnet ef dbcontext scaffold "$connnectionstr" Npgsql.EntityFrameworkCore.PostgreSQL
|
||||||
|
;;
|
||||||
|
|
||||||
|
"dbupdate")
|
||||||
|
dotnet ef migrations add "$2"
|
||||||
|
dotnet ef database update --connection "$connnectionstr";;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown command '$1', try 'dbinit'" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user