Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update postgres instruction #249

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,49 @@ This will install all the packages needed for development.

### Step 4: Set up PostgreSQL

Replace "dbname", "username", and "password" with the values in [local.py](config/settings/local.py):
Install for macOS:

```sql
```bash
# Install PostgreSQL
brew install postgresql@16

# Set PATH environment variable
echo 'export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

# Start PostgreSQL service
brew services start postgresql@16

# Log in to PostgreSQL
psql -d postgres
```

Install for Linux:

```bash
# Install PostgreSQL
sudo apt install postgresql

# Start PostgreSQL service
sudo systemctl start postgresql.service

# Log in to PostgreSQL
sudo -u postgres psql
CREATE DATABASE dbname;
CREATE USER username WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE dbname TO username;
```

Create a Role and Database:

```sql
CREATE ROLE admin_local WITH LOGIN PASSWORD 'password_local' CREATEDB CREATEROLE;
CREATE DATABASE katsu_local WITH OWNER = admin_local;
GRANT ALL PRIVILEGES ON DATABASE katsu_local TO admin_local;

-- Quit PostgreSQL
\q
```

Note: In some cases, existing PostgreSQL might cause issues. You may need to clean them up manually.

### Step 5: Set up database

With the database configured, run the following command to create the necessary database tables:
Expand Down
Loading