Sfoglia il codice sorgente

Minor - format code, add "CREATE TABLE IF NOT EXISTS" see BT#14091

jmontoyaa 7 anni fa
parent
commit
54ea6f5833
1 ha cambiato i file con 13 aggiunte e 1 eliminazioni
  1. 13 1
      plugin/dictionary/DictionaryPlugin.php

+ 13 - 1
plugin/dictionary/DictionaryPlugin.php

@@ -1,8 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
+/**
+ * Class DictionaryPlugin
+ */
 class DictionaryPlugin extends Plugin
 {
+    /**
+     * DictionaryPlugin constructor.
+     */
     protected function __construct()
     {
         parent::__construct(
@@ -23,9 +29,12 @@ class DictionaryPlugin extends Plugin
         return $result ? $result : $result = new self();
     }
 
+    /**
+     * @throws \Doctrine\DBAL\DBALException
+     */
     public function install()
     {
-        $sql = "CREATE TABLE plugin_dictionary (
+        $sql = "CREATE TABLE IF NOT EXISTS plugin_dictionary (
                 id INT NOT NULL AUTO_INCREMENT,
                 term VARCHAR(255) NOT NULL,
                 definition LONGTEXT NOT NULL,
@@ -34,6 +43,9 @@ class DictionaryPlugin extends Plugin
         Database::query($sql);
     }
 
+    /**
+     * @throws \Doctrine\DBAL\DBALException
+     */
     public function uninstall()
     {
         $sql = "DROP TABLE IF EXISTS plugin_dictionary";