Skip to content
Snippets Groups Projects
Commit 8e7f8859 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Use new method to collect driver-name and use it to optimize query

parent 21d3a719
No related branches found
No related tags found
No related merge requests found
......@@ -279,18 +279,28 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource
{
$stmt = 0;
$fine = true;
$driver = $this->db->getDriver();
$text = 'TEXT';
if ($driver === 'mysql') {
$text = 'MEDIUMTEXT';
}
foreach ($this->supportedSets as $set) {
$tableName = $this->getTableName($set);
$rows = $this->db->write(
"CREATE TABLE IF NOT EXISTS $tableName (entity_id VARCHAR(255) PRIMARY KEY NOT NULL, entity_data " .
"TEXT NOT NULL)"
);
$rows = $this->db->write(sprintf(
"CREATE TABLE IF NOT EXISTS $tableName (entity_id VARCHAR(255) PRIMARY KEY NOT NULL, "
. "entity_data %s NOT NULL)",
$text
));
if ($rows === false) {
$fine = false;
} else {
$stmt += $rows;
}
}
if (!$fine) {
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment