24 lines
959 B
MySQL
24 lines
959 B
MySQL
|
|
-- Transitional learning detect: user-confirmed label senses, pending mask review.
|
||
|
|
-- Detect output still does not auto-activate identities.
|
||
|
|
|
||
|
|
CREATE TABLE IF NOT EXISTS label_senses (
|
||
|
|
profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
|
||
|
|
normalized_label TEXT NOT NULL,
|
||
|
|
identity_hits INTEGER NOT NULL DEFAULT 0,
|
||
|
|
non_identity_hits INTEGER NOT NULL DEFAULT 0,
|
||
|
|
updated TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP::text,
|
||
|
|
PRIMARY KEY (profile_id, normalized_label)
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE TABLE IF NOT EXISTS pending_mask_reviews (
|
||
|
|
id TEXT PRIMARY KEY,
|
||
|
|
profile_id TEXT NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
|
||
|
|
conversation_id TEXT NOT NULL REFERENCES conversations(id) ON DELETE CASCADE,
|
||
|
|
user_message_id TEXT NOT NULL,
|
||
|
|
payload_json TEXT NOT NULL DEFAULT '{}',
|
||
|
|
created TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP::text
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_pending_mask_reviews_conv
|
||
|
|
ON pending_mask_reviews (profile_id, conversation_id);
|