Merge pull request #2679 from HB9HIL/migration_from_db_in_debug

Show latest Migration in Database in the Debug View
This commit is contained in:
Peter Goodhall
2023-11-12 14:44:26 +00:00
committed by GitHub
3 changed files with 29 additions and 0 deletions

View File

@@ -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;

View File

@@ -0,0 +1,20 @@
<?php
class MigrationVersion extends CI_Model {
function getMigrationVersion() {
$this->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;
}
}
}
?>

View File

@@ -21,6 +21,11 @@
<td>Base URL</td>
<td><span id="baseUrl"><a href="<?php echo $this->config->item('base_url')?>" target="_blank"><?php echo $this->config->item('base_url'); ?></a></span> <span data-toggle="tooltip" data-original-title="<?php echo lang('copy_to_clipboard'); ?>" onclick='copyURL("<?php echo $this->config->item('base_url'); ?>")'><i class="copy-icon fas fa-copy"></span></td>
</tr>
<tr>
<td>Migration</td>
<td><?php echo (isset($migration_version) ? $migration_version : "<span class='badge badge-danger'>There is something wrong with your Migration in Database!</span>"); ?></td>
</tr>
</table>
</div>
</div>