From d6e338c2b5ee625dab03d85f6862f84f6c3e420f Mon Sep 17 00:00:00 2001 From: xzchaoo Date: Tue, 25 Apr 2023 12:35:21 +0800 Subject: [PATCH] doc: add database doc in test scene (#18) --- docs/src/en/dev-guide/test/test-scenes.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/src/en/dev-guide/test/test-scenes.md b/docs/src/en/dev-guide/test/test-scenes.md index 266b078..7ab5498 100644 --- a/docs/src/en/dev-guide/test/test-scenes.md +++ b/docs/src/en/dev-guide/test/test-scenes.md @@ -145,3 +145,13 @@ scene-default_server_1 /entrypoint.sh Up (healthy) │ Grafana_Web_UI │ http://xx.xxx.xx.xxx:10915 │ └───────────────────────┴──────────────────────────────────────────────┘ ``` + +# Misc +## Update database +There is a service named `mysql-data-init` in `docker-compose.yaml`. It is used to initialize database tables and pre-populate some data for its test scene. +This service does three things: +1. mounts `server/extension/extension-common-flyway/src/main/resources/db/migration` to `/sql/0migration` in container +2. mounts `${test_scene_dir}/data.sql` to `/sql/1data/V999999__data.sql` in container +3. executes all sql scripts lexicographically under `/sql` in container + +Most scenes will choose to reuse the `data.sql` of scene-default, and the docker-compose of these scenes will refer to the `data.sql` of scene-default instead of copying a copy to their own directory.