bmc_hub/migrations/133_ordre_drafts.sql
Christian 3cddb71cec feat: Add Technician Dashboard V1, V2, and V3 with enhanced UI and functionality
- Introduced Technician Dashboard V1 (tech_v1_overview.html) with KPI cards and new cases overview.
- Implemented Technician Dashboard V2 (tech_v2_workboard.html) featuring a workboard layout for daily tasks and opportunities.
- Developed Technician Dashboard V3 (tech_v3_table_focus.html) with a power table for detailed case management.
- Created a dashboard selector page (technician_dashboard_selector.html) for easy navigation between dashboard versions.
- Added user dashboard preferences migration (130_user_dashboard_preferences.sql) to store default dashboard paths.
- Enhanced sag_sager table with assigned group ID (131_sag_assignment_group.sql) for better case management.
- Updated sag_subscriptions table to include cancellation rules and billing dates (132_subscription_cancellation.sql, 134_subscription_billing_dates.sql).
- Implemented subscription staging for CRM integration (136_simply_subscription_staging.sql).
- Added a script to move time tracking section in detail view (move_time_section.py).
- Created a test script for subscription processing (test_subscription_processing.py).
2026-02-17 08:29:05 +01:00

25 lines
1019 B
SQL

-- Migration 133: Ordre drafts persistence for global /ordre page
CREATE TABLE IF NOT EXISTS ordre_drafts (
id SERIAL PRIMARY KEY,
title VARCHAR(120) NOT NULL,
customer_id INTEGER REFERENCES customers(id) ON DELETE SET NULL,
lines_json JSONB NOT NULL DEFAULT '[]'::jsonb,
notes TEXT,
layout_number INTEGER,
created_by_user_id INTEGER REFERENCES users(user_id) ON DELETE SET NULL,
export_status_json JSONB NOT NULL DEFAULT '{}'::jsonb,
last_exported_at TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_ordre_drafts_user ON ordre_drafts(created_by_user_id);
CREATE INDEX IF NOT EXISTS idx_ordre_drafts_updated_at ON ordre_drafts(updated_at DESC);
CREATE INDEX IF NOT EXISTS idx_ordre_drafts_customer ON ordre_drafts(customer_id);
CREATE TRIGGER trigger_ordre_drafts_updated_at
BEFORE UPDATE ON ordre_drafts
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();