mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
contrib: Add some SQL statements to remove old subscribers
This commit is contained in:
18
openbsc/contrib/hlr-remove-old.sql
Normal file
18
openbsc/contrib/hlr-remove-old.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Remove old data from the database
|
||||
DELETE FROM Subscriber
|
||||
WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1;
|
||||
DELETE FROM Equipment
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM EquipmentWatch
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM SMS
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM VLR
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM ApduBlobs
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM Counters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
DELETE FROM RateCounters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
VACUUM;
|
Reference in New Issue
Block a user