diff options
| author | 2017-06-03 15:18:04 +0200 | |
|---|---|---|
| committer | 2017-06-03 15:18:04 +0200 | |
| commit | fd43ee546e419fc9fbb9a3ad974d2234d94cffaa (patch) | |
| tree | 2df9fd1daf5b994d7bbde8dd46f7605e4370c268 /app/Models/UserDAO.php | |
| parent | be0bcfef7e38f27284ec7b377b342ba389515964 (diff) | |
| parent | 6f3653d430c86b026f8e007a276fdba2b09b61b3 (diff) | |
Merge pull request #1549 from FreshRSS/dev1.7.0
Version 1.7.0
Diffstat (limited to 'app/Models/UserDAO.php')
| -rw-r--r-- | app/Models/UserDAO.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index a60caf395..310c7c096 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -14,21 +14,23 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { $ok = false; $bd_prefix_user = $db['prefix'] . $username . '_'; if (defined('SQL_CREATE_TABLES')) { //E.g. MySQL - $sql = sprintf(SQL_CREATE_TABLES, $bd_prefix_user, _t('gen.short.default_category')); + $sql = sprintf(SQL_CREATE_TABLES . SQL_CREATE_TABLE_ENTRYTMP, $bd_prefix_user, _t('gen.short.default_category')); $stm = $userPDO->bd->prepare($sql); $ok = $stm && $stm->execute(); } else { //E.g. SQLite global $SQL_CREATE_TABLES; + global $SQL_CREATE_TABLE_ENTRYTMP; if (is_array($SQL_CREATE_TABLES)) { - $ok = true; - foreach ($SQL_CREATE_TABLES as $instruction) { + $instructions = array_merge($SQL_CREATE_TABLES, $SQL_CREATE_TABLE_ENTRYTMP); + $ok = !empty($instructions); + foreach ($instructions as $instruction) { $sql = sprintf($instruction, $bd_prefix_user, _t('gen.short.default_category')); $stm = $userPDO->bd->prepare($sql); $ok &= ($stm && $stm->execute()); } } } - if ($insertDefaultFeeds) { + if ($ok && $insertDefaultFeeds) { if (defined('SQL_INSERT_FEEDS')) { //E.g. MySQL $sql = sprintf(SQL_INSERT_FEEDS, $bd_prefix_user); $stm = $userPDO->bd->prepare($sql); |
