mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Add instructions to make a db-dump
This commit is contained in:
@@ -27,6 +27,17 @@ If the database schema is changed, prisma-schema must be also updated. The smart
|
||||
|
||||
Prisma documentation: https://www.prisma.io/docs/orm/reference/prisma-cli-reference#db-pull
|
||||
|
||||
**Updating test data**
|
||||
|
||||
Sometimes you may want to add some test user or entries into the anonymous data in order to test something better. This can be done by `mariadb-dump` program which is included in the `mariadb` official docker image:
|
||||
|
||||
* Reset the anonymous data to the initial state: `npm run reset-anon-db`
|
||||
* Do the necessary edits, either via code, UI, or by executing commands in the mariadb cli.
|
||||
* Take a dump of the relevant tables: `docker exec nowdb-db-anon mariadb-dump <db_name> -uroot -padmin > ./<db_name>.sql`
|
||||
+ The db names are probably "now_test" or "now_log_test".
|
||||
+ Replace the .sql-files in `test_data/sqlfiles/` with the new dump you created.
|
||||
+ Commit and push the new dump - unless you did this for the staging-data dump, in which case you shouldn't commit and push.
|
||||
|
||||
**Mariadb-connector and transactions**
|
||||
|
||||
Prisma does not have proper support for connecting to multiple databases, and transactionality between them is therefore impossible. We need transactional write to both now and now_log databases. Therefore we use mariadb-connector for the write operations that need to be logged into the log-database.
|
||||
|
||||
Reference in New Issue
Block a user