Files
multica/server/migrations/120_github_pending_installation.up.sql
Bohan Jiang 64ce459e30 fix(github): preserve early installation webhook metadata (#4193)
Co-authored-by: J <j@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-17 12:26:25 +08:00

14 lines
652 B
SQL

-- Temporarily stores installation webhook account metadata when GitHub sends
-- installation.created before the setup callback has bound installation_id to
-- a workspace. No foreign keys: the workspace binding is resolved later by the
-- setup callback.
CREATE TABLE github_pending_installation (
installation_id BIGINT PRIMARY KEY,
account_login TEXT NOT NULL CHECK (account_login <> ''),
account_type TEXT NOT NULL DEFAULT 'User'
CHECK (account_type IN ('User', 'Organization')),
account_avatar_url TEXT,
received_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);