-- V14: Hardware shortcuts - tombol fisik HP yang diassign ke aksi tertentu
CREATE TABLE IF NOT EXISTS hardware_shortcuts (
    id           BIGSERIAL    PRIMARY KEY,
    guardian_id  BIGINT       REFERENCES users(id) ON DELETE SET NULL,
    user_id      BIGINT       NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    shortcut_key VARCHAR(50)  NOT NULL,
    button_name  VARCHAR(100),
    button_code  INT,
    enabled      BOOLEAN      NOT NULL DEFAULT TRUE,
    updated_at   TIMESTAMP    NOT NULL DEFAULT NOW(),
    CONSTRAINT uq_shortcut_user_key UNIQUE (user_id, shortcut_key)
);
CREATE INDEX IF NOT EXISTS idx_shortcut_user_id ON hardware_shortcuts(user_id);
