mirror of
https://github.com/itflow-org/itflow
synced 2026-07-23 00:40:45 +00:00
21 lines
676 B
PHP
21 lines
676 B
PHP
<?php
|
|
|
|
/*
|
|
* ITFlow - Database update to version 2.0.4 (from 2.0.3)
|
|
* Included by admin/database_updates.php - do not access directly
|
|
*/
|
|
|
|
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
|
|
|
|
// Clean up orphaned history
|
|
mysqli_query($mysqli, "
|
|
DELETE FROM `certificate_history`
|
|
WHERE `certificate_history_certificate_id` NOT IN (SELECT `certificate_id` FROM `certificates`);
|
|
");
|
|
|
|
// Add foreign key certificate history
|
|
mysqli_query($mysqli, "
|
|
ALTER TABLE `certificate_history`
|
|
ADD FOREIGN KEY (`certificate_history_certificate_id`) REFERENCES `certificates`(`certificate_id`) ON DELETE CASCADE
|
|
");
|