Chore:
- Update README.md - Update config to use postgresql - Add .vscode/settings.json
This commit is contained in:
@@ -1,12 +1,36 @@
|
||||
# CMT
|
||||
### Starting the application
|
||||
```bash
|
||||
cd backend
|
||||
fastapi run --reload app/main.py
|
||||
```
|
||||
### DB
|
||||
MySQL
|
||||
```sql
|
||||
-- db setup
|
||||
-- MySQL db setup
|
||||
cat db_setup.sql | mysql -u root -p
|
||||
-- table setup
|
||||
cat db_table_setup.sql | mysql -u admin -p CMT
|
||||
```
|
||||
Postgresql
|
||||
```bash
|
||||
# Installation - Arch
|
||||
sudo pacman -Syu postgresql
|
||||
|
||||
# Initialising db cluster
|
||||
sudo -u postgres initdb -D /var/lib/postgres/data
|
||||
|
||||
# enable + start service
|
||||
sudo systemctl enable --now postgresql
|
||||
|
||||
# Creating user
|
||||
sudo -u postgres createuser -P appuser
|
||||
# Creating db owned by this user
|
||||
sudo -u postgres createdb -O appuser db_name
|
||||
|
||||
# Test
|
||||
psql "postgresql://appuser:secret@localhost:5432/appdb"
|
||||
```
|
||||
### Testing
|
||||
```
|
||||
cd backend
|
||||
|
||||
Reference in New Issue
Block a user