git clone https://github.com/zakh-d/python-fs-internship-backend.git
Create .env file based on .env.example file
This requires you to have Docker installed on your PC.
docker compose up -d
Apply migrations to the db inside docker container. Check here how to do this.
To apply existing alembic migration to postgres inside docker container run following command
docker compose exec api alembic upgrade head
this would apply all existing migrations to the db.
To create new alembic migration run following command
docker compose exec api alembic revision --autogenerate -m 'migration description'
this would automatically check models, that were inheritted from Base class in app.db.models module, whether there were any changes, if so I would generate migrations files inside app/db/migrations folder. You MUST check created file
Just run prepared script
./test.sh
erDiagram
USER ||--o{ COMPANY_ACTION: relates
USER ||--o{ COMPANY: owns
USER {
uuid id
varchar email
varchar username
varchar first_name
varchar last_name
}
COMPANY ||--o{ COMPANY_ACTION: relates
COMPANY {
uuid id
uuid owner_id
varchar name
varchar description
}
COMPANY_ACTION {
uuid id
uuid company_id
uuid user_id
enum type
}