diff --git a/src/Medoo.php b/src/Medoo.php index 00cdb440..1d775670 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -234,9 +234,7 @@ public function __construct(array $options) } $option = $options['option'] ?? []; - $commands = (isset($options['command']) && is_array($options['command'])) ? - $options['command'] : - []; + $commands = []; switch ($this->type) { @@ -469,6 +467,10 @@ public function __construct(array $options) ); } + if (isset($options['command']) && is_array($options['command'])) { + $commands = array_merge($commands, $options['command']); + } + foreach ($commands as $value) { $this->pdo->exec($value); }