Files
coder/coderd/database/migrations/000312_webpush_subscriptions.up.sql
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
701 B
SQL
Raw Normal View History

2025-03-27 10:03:53 +00:00
-- webpush_subscriptions is a table that stores push notification
-- subscriptions for users. These are acquired via the Push API in the browser.
CREATE TABLE IF NOT EXISTS webpush_subscriptions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- endpoint is called by coderd to send a push notification to the user.
endpoint TEXT NOT NULL,
-- endpoint_p256dh_key is the public key for the endpoint.
endpoint_p256dh_key TEXT NOT NULL,
-- endpoint_auth_key is the authentication key for the endpoint.
endpoint_auth_key TEXT NOT NULL
);