This repository has been archived on 2025-02-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cavecomm/setupdb.sh
Tina_Azure bbf526f99f minor fix to avoid the creation of '' templates since crow is incapable of routing those to /<string> while trying to route them to / leading to a 404
obviously it's also possible to just give a general you have to name your template directive but as it stands i don't really see a need for it
2023-05-15 19:31:25 +02:00

81 lines
2.1 KiB
Bash

#!/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 psql -c "CREATE TABLE requests(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
customerName text,
customerEmailAddress text,
customerContactDetails text,
freelancerID INT,
templateID INT,
currencyPreference varchar(6),
priceUpFront decimal,
priceOnDeliver decimal,
requestDescription text,
accepted boolean,
upFrontInvoiceID text,
onDeliverInvoiceID text,
upFrontPaid boolean,
onDeliverPaid boolean,
completed boolean
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE freelancers(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
emailAddress text UNIQUE NOT NULL,
salt text NOT NULL,
hash text NOT NULL,
name text,
generalInformation text,
basicInformation text,
stripeAccountInformation text,
commissionLimit int,
loginValidationKey text
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE templates(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
freelancerID int,
name text NOT NULL,
content text,
contactData text,
contactInformation text,
currencyPreference text,
priceUpFront decimal,
priceOnDeliver decimal,
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE cryptoWallets(
id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
freelancerID int,
name text,
walletAddress text
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE passwordResetKeys(
freelancerEmail text PRIMARY KEY,
passwordResetKey text UNIQUE,
expiration timestamp
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE loginLockOut(
email text PRIMARY KEY,
attempts int,
expiration timestamp
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE aliasRoutes(
aliasName text PRIMARY KEY,
freelancerID int,
route text,
routeParameters text
);
" cavecomm