chore: update sqlite functions

This commit is contained in:
Steven
2023-12-17 14:16:34 +08:00
parent a9071d629a
commit 41cb597f03
8 changed files with 37 additions and 98 deletions

View File

@ -109,16 +109,7 @@ func (d *DB) ListUserSettings(ctx context.Context, find *store.FindUserSetting)
}
func vacuumUserSetting(ctx context.Context, tx *sql.Tx) error {
stmt := `
DELETE FROM
user_setting
WHERE
user_id NOT IN (
SELECT
id
FROM
user
)`
stmt := `DELETE FROM user_setting WHERE user_id NOT IN (SELECT id FROM user)`
_, err := tx.ExecContext(ctx, stmt)
if err != nil {
return err