- Updated task progress calculation logic to incorporate weights and time-based estimations for subtasks. - Improved SQL migrations to support new progress calculation methods and ensure accurate parent task updates. - Enhanced frontend components to conditionally display progress inputs based on task type and project settings. - Implemented socket events for real-time updates on subtask counts and progress changes, ensuring consistent UI behavior. - Added logging for progress updates and task state changes to improve debugging and user experience.
All database DDLs, DMLs and migrations relates to the application should be stored here as well.
Worklenz Database
Directory Structure
sql/- Contains all SQL files needed for database initializationmigrations/- Contains database migration scripts00-init-db.sh- Initialization script that executes SQL files in the correct order
SQL File Execution Order
The database initialization files should be executed in the following order:
sql/0_extensions.sql- PostgreSQL extensionssql/1_tables.sql- Table definitions and constraintssql/indexes.sql- All database indexessql/4_functions.sql- Database functionssql/triggers.sql- Database triggerssql/3_views.sql- Database viewssql/2_dml.sql- Data Manipulation Language statements (inserts, updates)sql/5_database_user.sql- Database user setup
Docker-based Setup
In the Docker environment, we use a shell script called 00-init-db.sh to control the SQL file execution order:
- The shell script creates a
sql/subdirectory if it doesn't exist - It copies all .sql files into this subdirectory
- It executes the SQL files from the subdirectory in the correct order
This approach prevents the SQL files from being executed twice by Docker's automatic initialization mechanism, which would cause errors for objects that already exist.
Manual Setup
If you're setting up the database manually, please follow the execution order listed above. Ensure your SQL files are in the sql/ subdirectory before executing the script.