mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
new MigrationVersion Model
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user