|
|
|
@ -23,8 +23,58 @@ docker.env files.
|
|
|
|
|
|
|
|
|
|
|
|
The following can be useful in case that automatic migrations throw errors.
|
|
|
|
The following can be useful in case that automatic migrations throw errors.
|
|
|
|
|
|
|
|
|
|
|
|
1. delete everything in the migrations folder except for __init__.py.
|
|
|
|
1. delete everything in the migrations folder except for `__init__.py`.
|
|
|
|
2. drop into my MySQL console and do: DELETE FROM django_migrations WHERE app='my_app'
|
|
|
|
2. drop into my MySQL console and do: `DELETE FROM django_migrations WHERE app='my_app'``
|
|
|
|
3. while at the MySQL console, drop all of the tables associated with my_app.
|
|
|
|
3. while at the MySQL console, drop all of the tables associated with my_app.
|
|
|
|
4. re-run ./manage.py makemigrations my_app - this generates a 0001_initial.py file in my migrations folder.
|
|
|
|
4. re-run `./manage.py makemigrations my_app` - this generates a 0001_initial.py file in my migrations folder.
|
|
|
|
5. run ./manage migrate my_app - I expect this command to re-build all my tables, but instead it says: "No migrations to apply."
|
|
|
|
5. run `./manage migrate my_app` - I expect this command to re-build all my tables, but instead it says: "No migrations to apply."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Development Notes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Information
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- default user wie vergeben in Schritt 3 [Development Setup > docker](#docker)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Development Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### docker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
# 1. Clone repository (see above)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1.2 Load Submodules
|
|
|
|
|
|
|
|
git submodule update --init
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 2. Install dependencies (docker, docker compose)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 3. Create default (super)user
|
|
|
|
|
|
|
|
docker compose exec master bash -c "cd jdav_web && python3 manage.py createsuperuser"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 4. Setup development environment
|
|
|
|
|
|
|
|
export GID=${GID}
|
|
|
|
|
|
|
|
export UID=${UID}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 5. Start docker compose
|
|
|
|
|
|
|
|
cd docker/development
|
|
|
|
|
|
|
|
docker compose up -d
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Erläuterungen:
|
|
|
|
|
|
|
|
- zu 2.: Im docker compose sollen die gleichen Nutzerrechte vorliegen, wie auf der entwickelnden Maschine um auto rebuild zu ermöglichen. Damit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Known Issues
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Bei `docker compose up -d` des development [docker-compose.yaml](docker/development/docker-compose.yaml)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
=> ERROR [master 6/7] RUN groupadd -g kasimir && useradd -g -u -m -d /app kasimir 0.2s
|
|
|
|
|
|
|
|
------
|
|
|
|
|
|
|
|
> [master 6/7] RUN groupadd -g kasimir && useradd -g -u -m -d /app kasimir:
|
|
|
|
|
|
|
|
0.141 groupadd: invalid group ID 'kasimir'
|
|
|
|
|
|
|
|
------
|
|
|
|
|
|
|
|
failed to solve: process "/bin/sh -c groupadd -g $GID $USER && useradd -g $GID -u $UID -m -d /app $USER" did not complete successfully: exit code: 3
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Dieser Fehler entsteht, wenn Schritt 2 im Abschnitt [Development Setup > docker](#docker) übersprungen wird.
|
|
|
|
|