Skip to content

Commit 55110ee

Browse files
committed
feat: add missing database indexes
1 parent 71e100e commit 55110ee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎mail-worker/src/init/init.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ const dbInit = {
8383
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_email_type_name ON email(type, name)`),
8484
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_email_type_create_time ON email(type, create_time)`),
8585
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_user_create_time ON user(create_time)`),
86-
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_user_type ON user(type)`)
86+
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_user_type ON user(type)`),
87+
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_attachments_email_type ON attachments(email_id, type)`),
88+
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_role_perm_role ON role_perm(role_id)`),
89+
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_oauth_oauth_user_id ON oauth(oauth_user_id)`)
8790
]);
8891
} catch (e) {
8992
console.warn(`跳过索引:${e.message}`);

0 commit comments

Comments
 (0)