a bunch of stuff happened. I'll do better next commit...

This commit is contained in:
2026-10-09 08:24:28 -04:00
parent bf8ad6a858
commit 4bceed7cb9
27 changed files with 540 additions and 112 deletions
@@ -0,0 +1,12 @@
-- Application-local IDs are stable user_serial values, not usernames.
CREATE TABLE IF NOT EXISTS user_application_accounts (
user_serial BIGINT UNSIGNED NOT NULL,
application_serial BIGINT UNSIGNED NOT NULL,
local_user_serial BIGINT UNSIGNED NOT NULL,
linked_by VARCHAR(128) NOT NULL,
linked_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_serial, application_serial),
UNIQUE KEY application_account (application_serial, local_user_serial),
FOREIGN KEY (user_serial) REFERENCES users(user_serial) ON DELETE CASCADE,
FOREIGN KEY (application_serial) REFERENCES applications(application_serial) ON DELETE CASCADE
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;