Fix setupdb #31

Merged
t_a merged 5 commits from setupdbfix into master 2023-07-09 22:16:55 +00:00
2 changed files with 9 additions and 6 deletions

View File

@@ -33,4 +33,4 @@ clean:
buildRun:
clear
g++ $(INC) -o cavecomm $(SRCFILES) $(DEF) $(LIBS)
./cavecomm src/default-cavecomm.conf
./cavecomm src/default-cavecomm.conf

13
setupdb.sh Normal file → Executable file
View File

@@ -1,7 +1,7 @@
#!/bin/sh
sudo -u postgres createuser -P -e cavecomm
sudo -u postgres createdb --owner=cavecomm cavecomm 'contains all the information for the cavecomm instance on this device'
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecomm;"
sudo -u postgres createuser -P -e cavecommadmin
sudo -u postgres createdb --owner=cavecommadmin cavecomm 'contains all the information for the cavecomm instance on this device'
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE cavecomm TO cavecommadmin;"
sudo -u postgres psql -c "CREATE TABLE requests(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
customerName text,
@@ -45,7 +45,7 @@ sudo -u postgres psql -c "CREATE TABLE templates(
contactInformation text,
currencyPreference text,
priceUpFront decimal,
priceOnDeliver decimal,
priceOnDeliver decimal
);
" cavecomm
@@ -75,6 +75,9 @@ sudo -u postgres psql -c "CREATE TABLE aliasRoutes(
aliasName text PRIMARY KEY,
freelancerID int,
route text,
routeParameters text
routeParameter text
);
" cavecomm
sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to cavecommadmin;"
sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to cavecommadmin;"
sudo -u postgres psql cavecomm -c "GRANT ALL ON ALL TABLES IN SCHEMA public to cavecommadmin;"