primary email change functionality
Build LinkLog Development Image / development-image (push) Successful in 12s

This commit is contained in:
2026-08-26 15:25:49 +02:00
parent 079eb146f6
commit fec7836384
14 changed files with 572 additions and 125 deletions
+32
View File
@@ -192,6 +192,38 @@ WHERE mastodon_post_ids IS NULL;
ALTER TABLE users ADD COLUMN otp_secret TEXT;
ALTER TABLE users ADD COLUMN otp_enabled INTEGER NOT NULL DEFAULT 0;
'''),
(12, '''
CREATE TABLE IF NOT EXISTS user_email_addresses (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
email TEXT NOT NULL UNIQUE,
verified INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS email_address_verification_tokens (
id TEXT PRIMARY KEY,
email_address_id TEXT NOT NULL,
token_hash TEXT NOT NULL UNIQUE,
expires_at TEXT NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(email_address_id) REFERENCES user_email_addresses(id) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_user_email_addresses_user_id ON user_email_addresses(user_id);
CREATE INDEX IF NOT EXISTS idx_email_address_verification_tokens_address_id ON email_address_verification_tokens(email_address_id);
'''),
(13, '''
CREATE TABLE IF NOT EXISTS pending_primary_email_changes (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
token_hash TEXT NOT NULL UNIQUE,
expires_at TEXT NOT NULL,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
);
''')
]