feat: Update frontend navigation and links for support and CRM sections fix: Modify subscription listing and stats endpoints to support 'all' status feat: Implement subscription status filter in the subscriptions list view feat: Redirect ticket routes to the new sag path feat: Integrate devportal routes into the main application feat: Create a wizard for location creation with nested floors and rooms feat: Add product suppliers table to track multiple suppliers per product feat: Implement product audit log to track changes in products feat: Extend location types to include kantine and moedelokale feat: Add last_2fa_at column to users table for 2FA grace period tracking
18 lines
553 B
SQL
18 lines
553 B
SQL
-- Migration 111: Product audit log
|
|
-- Track product changes (rename/delete)
|
|
|
|
CREATE TABLE IF NOT EXISTS product_audit_log (
|
|
id SERIAL PRIMARY KEY,
|
|
product_id INTEGER NOT NULL REFERENCES products(id) ON DELETE CASCADE,
|
|
event_type VARCHAR(50) NOT NULL,
|
|
user_id INTEGER,
|
|
changes JSONB,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_product_audit_log_product
|
|
ON product_audit_log(product_id);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_product_audit_log_created_at
|
|
ON product_audit_log(created_at);
|