OXYGENHUB
# c30444e35f2e oxygenhub / crates / hub / migrations / 0041_account_logins.sql
486 B · SQL · last changed Sign in with GitHub or Google 1 month ago source blame history raw
83940d53 Andy McCall ↶ 1
-- Sign-in with an external account (hub spec §5.1.2, #106): which
2
-- provider subject is which account, and the login name there.
3
CREATE TABLE account_logins (
4
    provider    TEXT NOT NULL,
5
    subject     TEXT NOT NULL,
6
    account_id  INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
7
    login       TEXT NOT NULL DEFAULT '',
8
    linked_ms   INTEGER NOT NULL,
9
    PRIMARY KEY (provider, subject)
10
);
11
CREATE INDEX account_logins_by_account ON account_logins (account_id);