summaryrefslogtreecommitdiffstats
path: root/db/old_migrations/patch-monitor-tls-info-add-fk.sql
blob: 9b9c2d2cbda646a2ff297f7ce2cfabbe18e0d2a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BEGIN TRANSACTION;

PRAGMA writable_schema = TRUE;

UPDATE
	SQLITE_MASTER
SET
	sql = replace(sql,
	'monitor_id INTEGER NOT NULL',
	'monitor_id INTEGER NOT NULL REFERENCES [monitor] ([id]) ON DELETE CASCADE ON UPDATE CASCADE'
)
WHERE
	name = 'monitor_tls_info'
	AND type = 'table';

PRAGMA writable_schema = RESET;

COMMIT;