g1t/services/identity/migrations/0004_email_verification.sql
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Email verification, password reset, and Git for AI scale positioning | 1 | ALTER TABLE users ADD COLUMN email_verified_at INTEGER; |
| 2 | ||
| 3 | -- Accounts that existed before verification was required. | |
| 4 | UPDATE users SET email_verified_at = unixepoch(); | |
| 5 | ||
| 6 | -- One-time links sent by email. id is the SHA-256 of the token in the link. | |
| 7 | CREATE TABLE email_tokens ( | |
| 8 | id TEXT PRIMARY KEY, | |
| 9 | user_id TEXT NOT NULL REFERENCES users (id) ON DELETE CASCADE, | |
| 10 | -- 'verify' or 'reset' | |
| 11 | kind TEXT NOT NULL, | |
| 12 | expires_at INTEGER NOT NULL | |
| 13 | ); | |
| 14 | CREATE INDEX email_tokens_user ON email_tokens (user_id, kind); |