From f82ab3313655bdcae40f0a5c453bb8f33a4eca28 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:34:18 +0100 Subject: [PATCH 1/4] loading MigrationVersion Model --- application/controllers/Debug.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index cca65943..75bddc0f 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -14,6 +14,10 @@ class Debug extends CI_Controller { { $this->load->helper('file'); + $this->load->model('MigrationVersion'); + + $data['migration_version'] = $this->MigrationVersion->getMigrationVersion(); + // Test writing to backup folder $backup_folder = $this->is_really_writable('backup'); $data['backup_folder'] = $backup_folder; @@ -29,7 +33,7 @@ class Debug extends CI_Controller { $data['page_title'] = "Debug"; $this->load->view('interface_assets/header', $data); - $this->load->view('debug/main'); + $this->load->view('debug/main', $data); $this->load->view('interface_assets/footer'); } From 2bab8a9633fe72ef6219548d9244763896a2e949 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:34:32 +0100 Subject: [PATCH 2/4] show migration value from db --- application/views/debug/main.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/views/debug/main.php b/application/views/debug/main.php index 8c07bddd..0b279ef2 100644 --- a/application/views/debug/main.php +++ b/application/views/debug/main.php @@ -21,6 +21,11 @@ Base URL config->item('base_url'); ?> ")'> + + Migration + There is something wrong with your Migration in Database!"); ?> + + From 8e3f2e8d6ef0e1eb5e1e40f6932b6b9bb5946ff9 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:34:48 +0100 Subject: [PATCH 3/4] new MigrationVersion Model --- application/models/MigrationVersion.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 application/models/MigrationVersion.php diff --git a/application/models/MigrationVersion.php b/application/models/MigrationVersion.php new file mode 100644 index 00000000..bec7d47a --- /dev/null +++ b/application/models/MigrationVersion.php @@ -0,0 +1,20 @@ +db->select_max('version'); + $query = $this->db->get('migrations'); + $migration_version = $query->row(); + + if ($query->num_rows() == 1) { + $migration_version = $query->row()->version; + return $migration_version; + } else { + return null; + } + } + +} + +?> From c55c3bb5947cdb30cc81d7b33fd0fce17c3e7f6f Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 12 Nov 2023 15:41:10 +0100 Subject: [PATCH 4/4] $data already in the header --- application/controllers/Debug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 75bddc0f..5d8d2a9c 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -33,7 +33,7 @@ class Debug extends CI_Controller { $data['page_title'] = "Debug"; $this->load->view('interface_assets/header', $data); - $this->load->view('debug/main', $data); + $this->load->view('debug/main'); $this->load->view('interface_assets/footer'); }