- Add migration 053 for approval columns - Checks if columns exist before adding (safe) - Adds: approved_hours, rounded_to, approval_note, billable, is_travel, approved_at, approved_by - Adds indexes for status and approved_at - Required for production deployment
91 lines
2.4 KiB
Markdown
91 lines
2.4 KiB
Markdown
# Release Notes - v1.3.84
|
|
|
|
**Release Date:** 2. januar 2026
|
|
|
|
## 🔧 Database Migration
|
|
|
|
### Timetracking Approval Columns
|
|
- **Added migration** for missing approval columns in `tmodule_times` table
|
|
- **Required for production** - local development already has these columns
|
|
|
|
### Columns Added (if missing):
|
|
- `approved_hours` DECIMAL(10,2) - Godkendte timer
|
|
- `rounded_to` DECIMAL(10,2) - Afrundingsinterval brugt
|
|
- `approval_note` TEXT - Godkendelsesnote
|
|
- `billable` BOOLEAN DEFAULT TRUE - Skal faktureres
|
|
- `is_travel` BOOLEAN DEFAULT FALSE - Indeholder kørsel
|
|
- `approved_at` TIMESTAMP - Tidspunkt for godkendelse
|
|
- `approved_by` INTEGER - Bruger der godkendte
|
|
|
|
### Indexes Added:
|
|
- `idx_tmodule_times_status` - For hurtigere status queries
|
|
- `idx_tmodule_times_approved_at` - For hurtigere approval queries
|
|
|
|
## 📝 Files Changed
|
|
|
|
- `migrations/053_timetracking_approval_columns.sql` - New migration file
|
|
|
|
## 🚀 Deployment Instructions
|
|
|
|
### CRITICAL - Run Migration First!
|
|
|
|
**På produktionsserveren:**
|
|
|
|
1. **SSH til serveren:**
|
|
```bash
|
|
ssh bmcadmin@172.16.31.183
|
|
```
|
|
|
|
2. **Naviger til projekt:**
|
|
```bash
|
|
cd /opt/bmc_hub
|
|
git fetch --tags
|
|
git checkout v1.3.84
|
|
```
|
|
|
|
3. **Kør migration (VIGTIGT!):**
|
|
```bash
|
|
docker-compose exec postgres psql -U bmcnetworks -d bmc_hub -f /app/migrations/053_timetracking_approval_columns.sql
|
|
```
|
|
|
|
**ELLER via docker cp hvis mounted wrong:**
|
|
```bash
|
|
docker cp migrations/053_timetracking_approval_columns.sql bmc-hub-postgres:/tmp/
|
|
docker-compose exec postgres psql -U bmcnetworks -d bmc_hub -f /tmp/053_timetracking_approval_columns.sql
|
|
```
|
|
|
|
4. **Genstart API:**
|
|
```bash
|
|
docker-compose restart api
|
|
```
|
|
|
|
5. **Verificer:**
|
|
```bash
|
|
# Test godkendelse i wizard
|
|
# Tjek logs for fejl
|
|
docker-compose logs -f api | grep -E "(Error|✅|❌)"
|
|
```
|
|
|
|
## ⚠️ Breaking Changes
|
|
|
|
None - backwards compatible migration
|
|
|
|
## 📊 Impact
|
|
|
|
- Fixes approval failures on production
|
|
- Safe to run - checks if columns exist before adding
|
|
- No data loss risk
|
|
|
|
## 🔍 Why This Was Needed
|
|
|
|
Production database was missing approval columns that exist in development:
|
|
- Local dev had columns from previous migrations
|
|
- Production was created before these columns were added
|
|
- This migration ensures both environments have same schema
|
|
|
|
---
|
|
|
|
**Git Tag:** v1.3.84
|
|
**Previous Version:** v1.3.83
|
|
**Migration:** 053_timetracking_approval_columns.sql
|