summaryrefslogtreecommitdiffstats
path: root/openbsc/contrib/hlr-remove-old.sql
blob: 626a331e194233f1d2013b285438cc646d387b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;