From db453e845613b89ddb583002404f094442ca0cc8 Mon Sep 17 00:00:00 2001 From: amrfayad Date: Tue, 8 Nov 2016 19:53:45 +0200 Subject: [PATCH] Add json Data Type & solve database name issues --- src/Nwidart/DbExporter/DbExporter.php | 2 +- src/Nwidart/DbExporter/DbMigrations.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Nwidart/DbExporter/DbExporter.php b/src/Nwidart/DbExporter/DbExporter.php index 25cef2e..d738977 100644 --- a/src/Nwidart/DbExporter/DbExporter.php +++ b/src/Nwidart/DbExporter/DbExporter.php @@ -24,7 +24,7 @@ protected function getTables() public function getTableIndexes($table) { $pdo = DB::connection()->getPdo(); - return $pdo->query('SHOW INDEX FROM ' . $table . ' WHERE Key_name != "PRIMARY"'); + return $pdo->query('SHOW INDEX FROM ' . $this->database . '.' . $table . ' WHERE Key_name != "PRIMARY"'); } /** diff --git a/src/Nwidart/DbExporter/DbMigrations.php b/src/Nwidart/DbExporter/DbMigrations.php index edc642f..ef4fece 100644 --- a/src/Nwidart/DbExporter/DbMigrations.php +++ b/src/Nwidart/DbExporter/DbMigrations.php @@ -158,6 +158,9 @@ public function convert($database = null) $options = substr($values->Type, $para + 1, -1); $numbers = ', array(' . $options . ')'; break; + case 'json' : + $method = 'json'; + break; } if ($values->Key == 'PRI') {