mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Add db container and restore script & instructions
This commit is contained in:
@@ -6,8 +6,22 @@ Rebuild of a fossil database application, old version at https://nowdatabase.luo
|
||||
|
||||
New version not deployed yet.
|
||||
|
||||
### Developer instructions
|
||||
## Developer instructions
|
||||
|
||||
Run `npm install` in all three folders: Project root, frontend, and backend.
|
||||
|
||||
If you have docker compose installed, run `npm run dev` in root to launch docker in development mode. Then, open localhost:5173 in browser.
|
||||
If you have docker compose installed, run `npm run dev` in root to launch docker in development mode. Then, open `localhost:5173` in browser.
|
||||
|
||||
### Restoring db from dump
|
||||
|
||||
Make an empty directory `sqlfiles` inside `data` folder which is in the repository root. Then, put the database dump files `now_test.sql`, `now_log_test.sql` and `now_view.sql` inside it.
|
||||
|
||||
The initialization file (`restore_and_create.sql`) will then restore the database from these files when the container is first run, and also creates a user `'now_test'@'localhost'` with password `mariadb_password` for the database. The root users password will be `admin`.
|
||||
|
||||
**Test that it worked:**
|
||||
|
||||
`docker exec -it nowdb-db mariadb -u now_test -p`. Enter the password `mariadb_password`.
|
||||
|
||||
Select database with `USE now_test;`.
|
||||
|
||||
Execute query: `select loc_name from now_loc where loc_name like "amb%";` which should print 9 rows if everything went right.
|
||||
Reference in New Issue
Block a user