MySQL (MariaDB on production) is the primary relational database storing all RapidPM data.
| Data | Tables |
|---|---|
| Users & Auth | User, Company, Role, UserCompanyRole |
| Projects | Project, Task, Predecessor, Task_Ordering |
| Documents | Artefact, ArtefactType, Container |
| Timesheets | Timesheet, TimesheetTask |
| Billing | Subscription, Invoice, Payment |
| Environment | Version | Variant |
|---|---|---|
| Production | 10.6.22 | MariaDB |
| Test | 8.0.44 | MySQL |
| Local | 8.0.x | MySQL |
| Server | Status | Port |
|---|---|---|
| rapidpm-prod | Host service (systemd) | 3306 |
| rapidpm-test | Host service (systemd) | 3306 |
| Local | System service | 3306 |
Note: MySQL runs on the host, not in Docker, for performance and persistence.
DB_HOST=localhost
DB_PORT=3306
DB_NAME=rapidpm
DB_USER=rapidpm
DB_PASSWORD=<secret>
# Flask-SQLAlchemy configuration
SQLALCHEMY_DATABASE_URI = f"mysql+mysqlconnector://{user}:{password}@{host}:{port}/{database}"
SQLALCHEMY_TRACK_MODIFICATIONS = False
| Rule | Description |
|---|---|
| UTC dates | Store all dates in UTC |
| Task_Ordering | It's a VIEW - never INSERT directly |
| display_order | Always set to MAX+1 for new tasks |
| Transactions | Commit in service layer only |
| Cascades | CASCADE for children, SET NULL for refs |
Managed by Flyway. Files in migrations/ folder.
Naming: V{version}__{description}.sql
Type: GPL v2 (MySQL) / GPL v2 (MariaDB)
Cost: Free (Community Edition)
See Licenses for details.
# Check status
systemctl status mysql
# Connect to database
mysql -u rapidpm -p rapidpm
# Check table sizes
SELECT table_name,
ROUND(data_length/1024/1024, 2) AS 'Data MB',
ROUND(index_length/1024/1024, 2) AS 'Index MB'
FROM information_schema.tables
WHERE table_schema = 'rapidpm'
ORDER BY data_length DESC;
# Full backup
mysqldump -u rapidpm -p rapidpm > backup.sql
# Restore
mysql -u rapidpm -p rapidpm < backup.sql