bmc_hub/migrations/1060_standalone_quick_time.sql
Christian 4871dd2d9e Add comprehensive test coverage for various modules
- Introduced tests for mail templates including ranking, rendering, and attachment handling.
- Added tests for time billing selection and approval processes, ensuring proper validation and state management.
- Implemented tests for case types in JavaScript, focusing on loading and editing functionality.
- Created tests for contact mail AI integration, ensuring proper parsing and error handling.
- Developed tests for dark theme CSS contrast and loading order.
- Added tests for invoice fee service, covering various scenarios including exemptions and invalid inputs.
- Implemented vendor resource tests, ensuring proper file handling and query validation.
2026-10-08 08:58:02 +02:00

17 lines
1005 B
SQL

-- Additive: standalone work and plans never create a case.
CREATE TABLE IF NOT EXISTS quick_time_batches (
request_id UUID PRIMARY KEY, actor_id INTEGER NOT NULL REFERENCES users(user_id),
payload JSONB NOT NULL, result JSONB NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS quick_time_items (
id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES users(user_id),
customer_id INTEGER REFERENCES customers(id), contact_id INTEGER REFERENCES contacts(id),
description TEXT NOT NULL, priority TEXT NOT NULL DEFAULT 'normal',
starts_at TIMESTAMPTZ NOT NULL, ends_at TIMESTAMPTZ NOT NULL,
state TEXT NOT NULL CHECK(state IN ('planned','registered')),
time_entry_id INTEGER UNIQUE REFERENCES tmodule_times(id),
created_by INTEGER NOT NULL REFERENCES users(user_id), created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
CHECK(ends_at>starts_at)
);
CREATE INDEX IF NOT EXISTS quick_time_items_period_idx ON quick_time_items(user_id,starts_at) WHERE state='planned';