File tree Expand file tree Collapse file tree
rustmail/src/db/operations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ -- Add migration script here
2+ CREATE TABLE IF NOT EXISTS api_keys (
3+ id INTEGER PRIMARY KEY AUTOINCREMENT,
4+ key_hash TEXT NOT NULL UNIQUE,
5+ name TEXT NOT NULL ,
6+ permissions TEXT NOT NULL ,
7+ created_at INTEGER NOT NULL ,
8+ expires_at INTEGER ,
9+ last_used_at INTEGER ,
10+ is_active INTEGER NOT NULL DEFAULT 1
11+ );
12+
13+ -- Index for faster lookups by hash (used on every API request)
14+ CREATE INDEX IF NOT EXISTS idx_api_keys_hash ON api_keys(key_hash);
15+
16+ -- Index for active keys only
17+ CREATE INDEX IF NOT EXISTS idx_api_keys_active ON api_keys(is_active);
Original file line number Diff line number Diff line change 1+ pub mod api_keys;
12pub mod features;
23pub mod init;
34pub mod logs;
@@ -6,6 +7,7 @@ pub mod reminders;
67pub mod scheduled;
78pub mod threads;
89
10+ pub use api_keys:: * ;
911pub use features:: * ;
1012pub use init:: * ;
1113pub use logs:: * ;
You can’t perform that action at this time.
0 commit comments