From 135b921db75da5995eab7e36393ecd4d2b0bc66f Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 4 Nov 2014 21:33:05 -0500 Subject: Switch to composer --- vendor/PicoDb/Schema.php | 54 ------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 vendor/PicoDb/Schema.php (limited to 'vendor/PicoDb/Schema.php') diff --git a/vendor/PicoDb/Schema.php b/vendor/PicoDb/Schema.php deleted file mode 100644 index a054ac09..00000000 --- a/vendor/PicoDb/Schema.php +++ /dev/null @@ -1,54 +0,0 @@ -db = $db; - } - - - public function check($last_version = 1) - { - $current_version = $this->db->getConnection()->getSchemaVersion(); - - if ($current_version < $last_version) { - return $this->migrateTo($current_version, $last_version); - } - - return true; - } - - - public function migrateTo($current_version, $next_version) - { - try { - - $this->db->startTransaction(); - - for ($i = $current_version + 1; $i <= $next_version; $i++) { - - $function_name = '\Schema\version_'.$i; - - if (function_exists($function_name)) { - call_user_func($function_name, $this->db->getConnection()); - $this->db->getConnection()->setSchemaVersion($i); - } - } - - $this->db->closeTransaction(); - } - catch (\PDOException $e) { - $this->db->setLogMessage($function_name.' => '.$e->getMessage()); - $this->db->cancelTransaction(); - return false; - } - - return true; - } -} \ No newline at end of file -- cgit v1.2.3