Added script to setup database locally on Linux/WSL (#1879)

* Created script to install and setup PostgreSQL database for Linux/WSL

* Updated Docs
This commit is contained in:
Gaurav
2023-10-05 19:47:27 +05:30
committed by GitHub
parent a04bdc6824
commit b8282e6789
3 changed files with 88 additions and 32 deletions

View File

@ -62,41 +62,13 @@ You can access them using `twenty` postgres user (password: `twenty`)
Install PostgresSQL on WSL2:
```bash
sudo apt update
sudo apt install postgresql postgresql-contrib
cd twenty/infra/dev/scripts && sudo ./setup-database.sh
```
Start postgresql service and connect to the database using default `postgres` user:
This script will install and setup PostgreSQL with dependencies.
```bash
sudo service postgresql start
sudo -u postgres psql
```
Create two databases:
```sql
CREATE DATABASE "default";
CREATE DATABASE "test";
```
Create a `twenty` user with password `twenty`:
```sql
CREATE USER twenty PASSWORD 'twenty';
ALTER USER twenty CREATEDB;
```
Create `metadata` schema:
```sql
CREATE SCHEMA IF NOT EXISTS "metadata";
GRANT ALL ON SCHEMA metadata TO twenty;
```
Activate `uuid-ossp` extension:
```sql
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
```
After successful setup, database will contain two databases: `default` and `test`,
You can access them using `twenty` postgres user (password: `twenty`)
</TabItem>
</Tabs>