The trick was to use a helper-field and a (decorated) @post_load method in the model that allows to fill the helper fields with the values (ints) instead of strings for enums. Trouble is: We are parsing strings from API/JSON and want to serialize as int (value in IntEnum). The helper fields also must be skipped when setting up the query. Pretty convoluted, but gets the jon done (finally). Also extended the database by new field 'interval_end' which is a preparation to allow not only timestamps but also intervals when specifying times for participants. |
||
|---|---|---|
| .. | ||
| add_user.py | ||
| BreCal.postman_collection.json | ||
| brecal.snk | ||
| BreCalApi.cs | ||
| BreCalApi.yaml | ||
| bump-version.sh | ||
| copyprod.sh | ||
| copytest.sh | ||
| create_schema.sql | ||
| Deployment.md | ||
| logo_bremen_calling.png | ||
| Readme.md | ||
| Remote BreCalEMSWE.postman_environment.json | ||
| sample_data.sql | ||
| sample_static_data.sql | ||
| update_1.1_to_1.2.sql | ||
| version.txt | ||
Database Bremen Calling
Server
mariadb v 10
Getting started
- Execute 'create_schema.sql' and import 'sample_data.sql'
If the database is updated or changed, please update these files. To avoid errors, it is best to drop the entire database, edit the create script and re-import the sample data.
Creating the dump file
mysqldump -u [username] -p --no-create-info --complete-insert bremen_calling > sample_data.sql
Removing existing tables
We want only to remove the tables in order to preserve user privileges
SELECT concat('DROP TABLE IF EXISTS `', table_name, '`;')
FROM information_schema.tables
WHERE table_schema = 'bremen_calling';
outputs complete drop statements
SET FOREIGN_KEY_CHECKS = 0;
-- Your semicolon separated list of DROP statements here
DROP TABLE IF EXISTS `notification`;
DROP TABLE IF EXISTS `role`;
DROP TABLE IF EXISTS `ship`;
DROP TABLE IF EXISTS `participant`;
DROP TABLE IF EXISTS `times`;
DROP TABLE IF EXISTS `role_securable_map`;
DROP TABLE IF EXISTS `user_role_map`;
DROP TABLE IF EXISTS `user`;
DROP TABLE IF EXISTS `securable`;
DROP TABLE IF EXISTS `shipcall_participant_map`;
DROP TABLE IF EXISTS `berth`;
DROP TABLE IF EXISTS `shipcall`;
SET FOREIGN_KEY_CHECKS = 1;