git_brcal/misc
2025-12-08 15:40:32 +01:00
..
add_user.py added a user login 2023-06-23 15:20:26 +02:00
Ampelfunktion.md adapting the .md documentation for the traffic state rules. 2024-09-04 12:29:06 +02:00
BreCal.postman_collection.json Updated postman collection 2024-07-25 08:14:36 +02:00
brecal.snk misc 2023-07-31 14:48:28 +02:00
BreCalApi.cs Extended API and added event type selection to about dialog 2025-02-10 08:18:32 +01:00
BreCalApi.md Put some extra info in the docs 2025-11-14 15:54:18 +01:00
BreCalApi.yaml Merge branch 'release/1.7.0' into develop 2025-12-05 15:58:38 +01:00
bump-version.sh Set development / feature branch to 'devel' settings, added scripts to move to test and to production. Added script to increase version, store version and to update the respective files 2023-10-29 17:56:06 +01:00
check_clear_double_times_entries.sql Updated create schema script and added script to clear times doublettes for same participant type 2025-12-08 15:40:18 +01:00
clear_data.sql Updated clear data script for the database (for purging all data via SQL) 2025-07-25 13:05:13 +02:00
clear_entries_for_participant.sql Simple purge script for data pertaining to a specific participant 2024-09-16 14:18:57 +02:00
copyprod.sh fixed gitignore file and copy scripts 2023-11-07 09:00:14 +01:00
copytest.sh fixed gitignore file and copy scripts 2023-11-07 09:00:14 +01:00
create_schema.sql Updated create schema script and added script to clear times doublettes for same participant type 2025-12-08 15:40:18 +01:00
Deployment.md Set development / feature branch to 'devel' settings, added scripts to move to test and to production. Added script to increase version, store version and to update the respective files 2023-10-29 17:56:06 +01:00
disclaimer.html Added disclaimer and data security file (taken from Word doc) 2024-06-21 15:26:13 +02:00
favicon.ico Some stuff for the website 2025-04-29 10:58:06 +02:00
index.html Some stuff for the website 2025-04-29 10:58:06 +02:00
logo_bremen_calling_small.png Some stuff for the website 2025-04-29 10:58:06 +02:00
logo_bremen_calling.png Mockup der Suche, Lokalisierung hinzugefügt (statisch via Resources) 2023-08-04 11:13:55 +02:00
notifications.md Added new notifications to basic types 2025-01-10 11:48:11 +01:00
product_codes.txt added product code info for vsproj file 2024-07-02 10:05:45 +02:00
Readme_yaml.md Fixed error in validation when not all fields are transmitted. Added UI for Notification flags. 2024-12-05 18:39:28 +01:00
Readme.md Added ChatGPT-created Mermaid database diagram to the Readme file 2025-12-08 15:40:32 +01:00
ReleaseNotes.md Changed Win Target to .NET8, updated YAML for user notification event selection 2025-02-10 08:18:17 +01:00
Remote BreCalEMSWE.postman_environment.json Updated postman collection 2023-06-27 11:34:43 +02:00
requirements.txt Upgrade to python 3.12 on the server, exported current requirements 2024-09-23 08:09:59 +02:00
sample_data.sql database extension 2023-10-06 16:13:05 +02:00
sample_static_data.sql Set development / feature branch to 'devel' settings, added scripts to move to test and to production. Added script to increase version, store version and to update the respective files 2023-10-29 17:56:06 +01:00
update_1.1_to_1.2.sql For intervals there are now 2 fields in the times object: eta_interval_end and etd_interval_end 2024-04-03 10:39:32 +02:00
update_1.5_to_1.6.sql fixed database upgrade script (1.5 -> 1.6) 2024-11-19 12:11:57 +01:00
update_1.6_to_1.7.sql Changed Win Target to .NET8, updated YAML for user notification event selection 2025-02-10 08:18:17 +01:00
version.txt Merge branch 'release/1.7.0' into develop 2025-12-05 15:58:38 +01:00
weserport.md Create assignment and un-assignment notifications 2024-12-10 10:30:26 +01:00

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;

Schema

erDiagram
    participant {
        INT id PK
        VARCHAR name
        VARCHAR street
        VARCHAR postal_code
        VARCHAR city
        INT type
        INT flags
    }
    port {
        INT id PK
        VARCHAR name
        CHAR locode
    }
    berth {
        INT id PK
        VARCHAR name
        BIT lock
        INT owner_id FK
        INT authority_id FK
        INT port_id FK
        BIT deleted
    }
    ship {
        INT id PK
        VARCHAR name
        INT imo
        VARCHAR callsign
        INT participant_id FK
        FLOAT length
        FLOAT width
        BIT is_tug
        INT bollard_pull
        INT eni
        BIT deleted
    }
    shipcall {
        INT id PK
        INT ship_id FK
        TINYINT type
        DATETIME eta
        DATETIME etd
        INT arrival_berth_id FK
        INT departure_berth_id FK
        INT port_id FK
        INT flags
        BIT tug_required
        BIT pilot_required
    }
    times {
        INT id PK
        INT shipcall_id FK
        INT participant_id FK
        INT berth_id FK
        INT participant_type
        DATETIME eta_berth
        DATETIME etd_berth
        DATETIME lock_time
        DATETIME zone_entry
    }
    notification {
        INT id PK
        INT shipcall_id FK
        INT participant_id FK
        TINYINT level
        TINYINT type
    }
    history {
        INT id PK
        INT participant_id FK
        INT user_id FK
        INT shipcall_id FK
        DATETIME timestamp
        DATETIME eta
        INT type
        INT operation
    }
    shipcall_participant_map {
        INT id PK
        INT shipcall_id FK
        INT participant_id FK
        INT type
    }
    shipcall_tug_map {
        INT id PK
        INT shipcall_id FK
        INT ship_id FK
    }
    participant_port_map {
        INT id PK
        INT participant_id FK
        INT port_id FK
    }
    user {
        INT id PK
        INT participant_id FK
        VARCHAR first_name
        VARCHAR last_name
        VARCHAR user_name
        VARCHAR user_email
    }
    role {
        INT id PK
        VARCHAR name
        VARCHAR description
    }
    securable {
        INT id PK
        VARCHAR name
    }
    role_securable_map {
        INT id PK
        INT role_id FK
        INT securable_id FK
    }
    user_role_map {
        INT id PK
        INT user_id FK
        INT role_id FK
    }

    participant ||--o{ berth : owner_id
    participant ||--o{ berth : authority_id
    port ||--o{ berth : port_id
    participant ||--o{ ship : participant_id
    ship ||--o{ shipcall : ship_id
    berth ||--o{ shipcall : arrival_berth_id
    berth ||--o{ shipcall : departure_berth_id
    port ||--o{ shipcall : port_id
    shipcall ||--|| times : shipcall_id
    participant ||--|| times : participant_id
    berth ||--o{ times : berth_id
    shipcall ||--o{ notification : shipcall_id
    participant ||--o{ notification : participant_id
    participant ||--o{ history : participant_id
    user ||--o{ history : user_id
    shipcall ||--o{ history : shipcall_id
    shipcall ||--o{ shipcall_participant_map : shipcall_id
    participant ||--o{ shipcall_participant_map : participant_id
    shipcall ||--o{ shipcall_tug_map : shipcall_id
    ship ||--o{ shipcall_tug_map : ship_id
    participant ||--o{ participant_port_map : participant_id
    port ||--o{ participant_port_map : port_id
    participant ||--o{ user : participant_id
    user ||--o{ user_role_map : user_id
    role ||--o{ user_role_map : role_id
    role ||--o{ role_securable_map : role_id
    securable ||--o{ role_securable_map : securable_id