feat: align account lifecycle

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
zyycn
2026-06-14 03:35:57 +08:00
co-authored by Codex
parent 178268bf90
commit 9aa54569fa
18 changed files with 666 additions and 79 deletions
+12
View File
@@ -64,6 +64,18 @@ create table if not exists accounts (
create index if not exists idx_accounts_status on accounts(status);
create index if not exists idx_accounts_identity on accounts(account_id, user_id) where account_id is not null;
-- ============================================
-- Account Refresh Leases
-- ============================================
create table if not exists account_refresh_leases (
account_id text primary key references accounts(id) on delete cascade,
owner text not null,
expires_at text not null,
updated_at text not null
);
create index if not exists idx_account_refresh_leases_expires on account_refresh_leases(expires_at);
-- ============================================
-- Account Usage Statistics
-- ============================================