diff --git a/README.md b/README.md index 69007a3..8863568 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ management tool for equipment and book rental ## Development environment -### Setup with docker and docker-compose +### Setup with docker (compose) #### First Up (or entirely rebuild) @@ -38,3 +38,14 @@ $ docker compose -f docker/test/docker-compose.yml up --abort-on-container-exit `docker compose down -v` +### Setup VSCode + +write it down in your `.vscode/settings.json` + +```json +{ + "go.testEnvVars": { + "MYSQL_DATABASE": "test" + } +} +``` diff --git a/docker-compose.yml b/docker-compose.yml index c16b91c..77c9f8d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,6 @@ services: MYSQL_USERNAME: root MYSQL_PASSWORD: password volumes: - - booq-db:/var/lib/mysql - ./docker/init.sql:/docker-entrypoint-initdb.d/init.sql expose: - '3306' @@ -31,8 +30,6 @@ services: MINIO_ROOT_PASSWORD: password MINIO_ACCESS_KEY: minio_access_key MINIO_SECRET_KEY: minio_secret_key - volumes: - - booq-s3:/data s3-init: image: minio/mc depends_on: @@ -81,7 +78,3 @@ services: restart: always ports: - 8000:8080 - -volumes: - booq-db: - booq-s3: diff --git a/docker/init.sql b/docker/init.sql index 1bca0ce..de8fcbe 100644 --- a/docker/init.sql +++ b/docker/init.sql @@ -3,3 +3,5 @@ SET SET collation_server = 'utf8mb4_general_ci'; + +CREATE DATABASE IF NOT EXISTS `test`; diff --git a/router/item_test.go b/router/items_test.go similarity index 100% rename from router/item_test.go rename to router/items_test.go