mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
warning if migfile locks migrations (basic implementation)
This commit is contained in:
@@ -36,8 +36,20 @@ class Debug extends CI_Controller
|
||||
$data['calls_wo_sid'] = $this->Debug_model->calls_without_station_id();
|
||||
}
|
||||
|
||||
// get mig version from database
|
||||
$data['migration_version'] = $this->Debug_model->getMigrationVersion();
|
||||
|
||||
// get mig version from config file
|
||||
$this->load->config('migration');
|
||||
$data['migration_config'] = $this->config->item('migration_version');
|
||||
|
||||
// compare mig versions
|
||||
if ($data['migration_version'] !== $data['migration_config'] && file_exists('application/cache/.migration_running')) {
|
||||
$data['migration_is_uptodate'] = false;
|
||||
} else {
|
||||
$data['migration_is_uptodate'] = true;
|
||||
}
|
||||
|
||||
// Test writing to backup folder
|
||||
$backup_folder = $this->permissions->is_really_writable('backup');
|
||||
$data['backup_folder'] = $backup_folder;
|
||||
|
||||
@@ -39,6 +39,16 @@
|
||||
<td><?= __("Migration"); ?></td>
|
||||
<td><?php echo (isset($migration_version) ? $migration_version : "<span class='badge text-bg-danger'>". __("There is something wrong with your Migration in Database!") . "</span>"); ?></td>
|
||||
</tr>
|
||||
<?php if (!$migration_is_uptodate) { ?>
|
||||
</table>
|
||||
<div class="alert alert-danger mt-3 mb-3">
|
||||
<h5><?= __("Migration is outdated and locked!"); ?></h5>
|
||||
<p><?= sprintf(__("The current migration is not the version it is supposed to be. Reload this page. If this warning persists, your migration is probably locked due to a past failed process. Check the folder %s for a file called %s and remove this file to force the migration to run again."), "'application/cache/'", "'.migration_running'"); ?></p>
|
||||
<p><?= sprintf(__("Current migration is %s"), $migration_version); ?><br>
|
||||
<?= sprintf(__("Migration should be %s"), $migration_config); ?></p>
|
||||
</div>
|
||||
<table>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td><?= __("Environment"); ?></td>
|
||||
<td><?php echo ENVIRONMENT; ?></td>
|
||||
|
||||
Reference in New Issue
Block a user