-
Notifications
You must be signed in to change notification settings - Fork 5
/
db_setup.sh
16 lines (14 loc) · 882 Bytes
/
db_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Refernce to install postgres
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
# Install DB requirements
sudo apt update
sudo apt install -y postgresql postgresql-contrib
sudo apt-get install -y libpq-dev python-dev
# Default password for user postgres
echo "Setting up Postgres password, database and table"
password="bota@123"
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '$password';"
sudo -u postgres psql -c "CREATE DATABASE bota;"
sudo -u postgres psql -d bota -c "create table user_info (discord_id bigint unique,discord_name text,steam_id bigint, language text, others jsonb);"
sudo -u postgres psql -d bota -c "create table alias (alias_name text unique,steam_id bigint, discord_id bigint);"
sudo -u postgres psql -d bota -c "create table guild (id bigint unique,name text,prefix text,block_channel text[]);"