diff --git a/src/Db/PdoRepository.php b/src/Db/PdoRepository.php index 7e680c7c..ba7866d2 100644 --- a/src/Db/PdoRepository.php +++ b/src/Db/PdoRepository.php @@ -184,25 +184,26 @@ public function getStatistics() public function initSchema(): void { + $profileColumnType = $this->driverName == 'mysql' ? 'LONGTEXT' : 'TEXT'; $this->pdo->exec(sprintf(' CREATE TABLE IF NOT EXISTS %s ( - "id" CHAR(24) PRIMARY KEY, - "profile" TEXT NOT NULL, - "url" TEXT NULL, - "SERVER" TEXT NULL, - "GET" TEXT NULL, - "ENV" TEXT NULL, - "simple_url" TEXT NULL, - "request_ts" INTEGER NOT NULL, - "request_ts_micro" NUMERIC(15, 4) NOT NULL, - "request_date" DATE NOT NULL, - "main_wt" INTEGER NOT NULL, - "main_ct" INTEGER NOT NULL, - "main_cpu" INTEGER NOT NULL, - "main_mu" INTEGER NOT NULL, - "main_pmu" INTEGER NOT NULL + "id" CHAR(24) PRIMARY KEY, + "profile" %s NOT NULL, + "url" TEXT NULL, + "SERVER" TEXT NULL, + "GET" TEXT NULL, + "ENV" TEXT NULL, + "simple_url" TEXT NULL, + "request_ts" INTEGER NOT NULL, + "request_ts_micro" NUMERIC(15, 4) NOT NULL, + "request_date" DATE NOT NULL, + "main_wt" INTEGER NOT NULL, + "main_ct" INTEGER NOT NULL, + "main_cpu" INTEGER NOT NULL, + "main_mu" INTEGER NOT NULL, + "main_pmu" INTEGER NOT NULL ) - ', $this->table)); + ', $this->table, $profileColumnType)); $this->pdo->exec(sprintf(' CREATE TABLE IF NOT EXISTS %s ( "id" CHAR(24) PRIMARY KEY,