mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
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:
@@ -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;
|
||||
|
||||
20
application/models/MigrationVersion.php
Normal file
20
application/models/MigrationVersion.php
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user