-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Database Setup and Migrations #2994
base: main
Are you sure you want to change the base?
Conversation
The Fundraising Application has two different database environments: | ||
|
||
- The **local development environment**. We're running a MariaDB database in a Docker container for local user and acceptance testing. We are using an in-memory SQLite database for running unit tests. This makes running the tests fast and allows for a clear separation between interactive testing and automated testing. | ||
- The **server environment** has a dedicated database server with two databases (test and production) that our test and production web servers connect to. The Fundraising App and the Fundraising Operation Center both share the same production or testing database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The **server environment** has a dedicated database server with two databases (test and production) that our test and production web servers connect to. The Fundraising App and the Fundraising Operation Center both share the same production or testing database. | |
- The **server environment** is running on a dedicated database server with two databases (test and production) that our test and production web servers connect to. The Fundraising App and the Fundraising Operation Center both share the same production or testing database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe "consists of" or just "uses"? Pinging @Abban for a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Consists of" is good
If you're getting errors from the application after the containers are up, check if the database tables exist by running the following command: | ||
|
||
```shell | ||
docker compose exec database mysql -u fundraising -p"INSECURE PASSWORD" fundraising -e "SHOW TABLES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker compose exec database mysql -u fundraising -p"INSECURE PASSWORD" fundraising -e "SHOW TABLES" | |
docker compose exec database mysql -u fundraising -p "INSECURE PASSWORD" fundraising -e "SHOW TABLES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this is one of the pecularities of the MySQL client: if you specify -p something
it will interpret that as "ask for a password and use parameter 'something'". If its -psomething
it will interpret that as "Use password 'something'". And sometimes will give a warning about that practice because that command can then end up in the bash history, revealing the password.
2. Run CI and fix failing tests. | ||
3. Run the database migration on the *old* version of the database schema | ||
4. User-test the changed database (to check if the migrated database is correct) | ||
5. Re-generate SQL for the local environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this point refer to ### Regenerating the local SQL
? Maybe we could link there or add the command here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments above for suggestions/change requests
Co-authored-by: Co <[email protected]>
Co-authored-by: Co <[email protected]>
How to integrate a database change from a bounded context in the Fundraising Application