From 8608e8d85f23acc719bd1626b164c1ba16e94ed3 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 8 Dec 2024 08:46:49 +0100 Subject: [PATCH] Using only unique index --- application/migrations/230_tle_cron.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/migrations/230_tle_cron.php b/application/migrations/230_tle_cron.php index 84e1c683d..a68e702f8 100644 --- a/application/migrations/230_tle_cron.php +++ b/application/migrations/230_tle_cron.php @@ -18,14 +18,15 @@ class Migration_tle_cron extends CI_Migration { $this->db->insert_batch('cron', $data); } - $this->dbtry("ALTER TABLE tle ADD CONSTRAINT tle_unique_satelliteid_FK FOREIGN KEY (satelliteid) REFERENCES satellite (id) ON DELETE CASCADE ON UPDATE RESTRICT;"); + $this->dbtry("ALTER TABLE tle ADD CONSTRAINT tle_unique_satelliteid UNIQUE (satelliteid);"); + } public function down() { if ($this->chk4cron('update_tle') > 0) { $this->db->query("delete from cron where id='update_update_tle'"); } - $this->dbtry("alter table tle drop foreign key tle_unique_satelliteid_FK;"); + $this->dbtry("ALTER TABLE tle DROP INDEX tle_unique_satelliteid;"); } function chk4cron($cronkey) {