Просмотр исходного кода

Merge pull request #1321 from Alkarex/drop-tables

PostgreSQL SQL DROP TABLE
Alexandre Alapetite 9 лет назад
Родитель
Сommit
1c8cfc3e02
3 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      app/SQL/install.sql.mysql.php
  2. 1 1
      app/SQL/install.sql.pgsql.php
  3. 1 1
      app/SQL/install.sql.sqlite.php

+ 1 - 1
app/SQL/install.sql.mysql.php

@@ -63,7 +63,7 @@ INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) V
 INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS @ GitHub", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400);
 ');
 
-define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS `%1$sentry`, `%1$sfeed`, `%1$scategory`');
 
 define('SQL_UPDATE_UTF8MB4', '
 ALTER DATABASE `%2$s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

+ 1 - 1
app/SQL/install.sql.pgsql.php

@@ -56,4 +56,4 @@ $SQL_CREATE_TABLES = array(
 'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) SELECT \'https://github.com/FreshRSS/FreshRSS/releases.atom\', 1, \'FreshRSS @ GitHub\', \'https://github.com/FreshRSS/FreshRSS/\', \'FreshRSS releases @ GitHub\', 86400 WHERE NOT EXISTS (SELECT id FROM "%1$sfeed" WHERE url = \'https://github.com/FreshRSS/FreshRSS/releases.atom\');',
 );
 
-define('SQL_DROP_TABLES', 'DROP TABLES "%1$sentry", "%1$sfeed", "%1$scategory"');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS "%1$sentry", "%1$sfeed", "%1$scategory"');

+ 1 - 1
app/SQL/install.sql.sqlite.php

@@ -59,4 +59,4 @@ $SQL_CREATE_TABLES = array(
 'INSERT OR IGNORE INTO `feed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS releases", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400);',
 );
 
-define('SQL_DROP_TABLES', 'DROP TABLES entry, feed, category');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS entry, feed, category');