17 lines
867 B
MySQL
17 lines
867 B
MySQL
|
|
-- Dashboard-Widgets: explizite Feature-Anforderungen (Custom) statt nur widget_catalog.requires_feature
|
||
|
|
-- Kein Eintrag in dashboard_widget_requirement_custom → Anforderungen aus Code (Katalog).
|
||
|
|
-- Eintrag vorhanden → AND über alle zugeordneten features (0 Zeilen = kein Feature nötig).
|
||
|
|
|
||
|
|
CREATE TABLE IF NOT EXISTS dashboard_widget_requirement_custom (
|
||
|
|
widget_id VARCHAR(64) PRIMARY KEY,
|
||
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE TABLE IF NOT EXISTS widget_feature_requirements (
|
||
|
|
widget_id VARCHAR(64) NOT NULL REFERENCES dashboard_widget_requirement_custom (widget_id) ON DELETE CASCADE,
|
||
|
|
feature_id TEXT NOT NULL REFERENCES features (id) ON DELETE CASCADE,
|
||
|
|
PRIMARY KEY (widget_id, feature_id)
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_widget_feature_requirements_feature_id ON widget_feature_requirements (feature_id);
|