diff --git a/Connection.php b/Connection.php index ee16a5e..5dbf36f 100644 --- a/Connection.php +++ b/Connection.php @@ -157,6 +157,7 @@ public function getIsActive() public function getClient(): Client { + $this->open(); return $this->_client; } diff --git a/console/controllers/MigrateController.php b/console/controllers/MigrateController.php index f36c18d..77654d5 100644 --- a/console/controllers/MigrateController.php +++ b/console/controllers/MigrateController.php @@ -39,7 +39,7 @@ public function createMigrationHistoryTable() 'date' => 'Date', 'apply_time' => 'UInt32', 'is_deleted' => 'UInt8' //0 active 1 //deleted - ], 'ENGINE=ReplacingMergeTree(date, version, 8192, apply_time)')->execute(); + ], 'ENGINE=ReplacingMergeTree() ORDER BY date')->execute(); $this->addMigrationHistory(self::BASE_MIGRATION); $this->stdout("Done.\n", Console::FG_GREEN); @@ -143,4 +143,4 @@ private function insertHistory(string $version, bool $isDelete = false): void 'is_deleted' => (int) $isDelete ])->execute(); } -} \ No newline at end of file +}