1
0
mirror of https://github.com/ddworken/hishtory.git synced 2025-03-11 05:38:11 +01:00

Skip deep cleans for sqlite DBs ()

* Add explicit DROP TABLE directives for temp_inactive_devices and drop the TEMP qualifier for non-postgres DBs, fixes 

* Revert "Add explicit DROP TABLE directives for temp_inactive_devices and drop the TEMP qualifier for non-postgres DBs, fixes "

This reverts commit db6d8413a7.

* Skip deep cleans for sqlite DBs
This commit is contained in:
David Dworken 2025-01-20 18:50:33 -07:00 committed by GitHub
parent a4ff05c0fa
commit f8c414b2c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -429,6 +429,10 @@ func (db *DB) GenerateAndStoreActiveUserStats(ctx context.Context) error {
}
func (db *DB) SelfHostedDeepClean(ctx context.Context) error {
if db.Name() == "sqlite" {
// sqlite doesn't support the `(now() - INTERVAL '90 days')` syntax used in the below queries.
return nil
}
return db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
runDeletes := os.Getenv("HISHTORY_SELF_HOSTED_DEEP_CLEAN") != ""
r := tx.Exec(`