]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBStructure.php
spelling: expiry
[friendica.git] / src / Database / DBStructure.php
index e3af408b9e4f9991e26e4c9e54dbb4f712004408..dc1e785a50071dac4875bbcc3967ea0d76b60f3e 100644 (file)
@@ -74,7 +74,7 @@ class DBStructure
                $old_tables = ['fserver', 'gcign', 'gcontact', 'gcontact-relation', 'gfollower' ,'glink', 'item-delivery-data',
                        'item-activity', 'item-content', 'item_id', 'participation', 'poll', 'poll_result', 'queue', 'retriever_rule',
                        'deliverq', 'dsprphotoq', 'ffinder', 'sign', 'spam', 'term', 'user-item', 'thread', 'item', 'challenge',
-                       'auth_codes', 'tokens', 'clients', 'profile_check', 'host', 'conversation', 'fcontact', 'config'];
+                       'auth_codes', 'tokens', 'clients', 'profile_check', 'host', 'conversation', 'fcontact', 'addon'];
 
                $tables = DBA::selectToArray('INFORMATION_SCHEMA.TABLES', ['TABLE_NAME'],
                        ['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']);
@@ -182,9 +182,10 @@ class DBStructure
                $status = self::update($verbose, true);
 
                if ($enable_maintenance_mode) {
-                       DI::config()->set('system', 'maintenance', false, false);
-                       DI::config()->delete('system', 'maintenance_reason', false);
-                       DI::config()->save();
+                       DI::config()->beginTransaction()
+                                               ->set('system', 'maintenance', false)
+                                               ->delete('system', 'maintenance_reason')
+                                               ->commit();
                }
 
                return $status;
@@ -782,7 +783,7 @@ class DBStructure
                        }
 
                        if (!DBA::exists('verb', ['id' => 0])) {
-                               DBA::insert('verb', ['name' => '']);
+                               DBA::insert('verb', ['name' => ''], Database::INSERT_IGNORE);
                                $lastid = DBA::lastInsertId();
                                if ($lastid != 0) {
                                        DBA::update('verb', ['id' => 0], ['id' => $lastid]);
@@ -818,7 +819,7 @@ class DBStructure
                }
 
                if (self::existsTable('contact') && !DBA::exists('contact', ['id' => 0])) {
-                       DBA::insert('contact', ['nurl' => '']);
+                       DBA::insert('contact', ['nurl' => ''], Database::INSERT_IGNORE);
                        $lastid = DBA::lastInsertId();
                        if ($lastid != 0) {
                                DBA::update('contact', ['id' => 0], ['id' => $lastid]);
@@ -833,7 +834,7 @@ class DBStructure
                }
 
                if (self::existsTable('tag') && !DBA::exists('tag', ['id' => 0])) {
-                       DBA::insert('tag', ['name' => '']);
+                       DBA::insert('tag', ['name' => ''], Database::INSERT_IGNORE);
                        $lastid = DBA::lastInsertId();
                        if ($lastid != 0) {
                                DBA::update('tag', ['id' => 0], ['id' => $lastid]);
@@ -849,7 +850,7 @@ class DBStructure
 
                if (self::existsTable('permissionset')) {
                        if (!DBA::exists('permissionset', ['id' => 0])) {
-                               DBA::insert('permissionset', ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '']);
+                               DBA::insert('permissionset', ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => ''], Database::INSERT_IGNORE);
                                $lastid = DBA::lastInsertId();
                                if ($lastid != 0) {
                                        DBA::update('permissionset', ['id' => 0], ['id' => $lastid]);
@@ -877,7 +878,7 @@ class DBStructure
                                        }
                                        $fields = ['id' => $set['psid'], 'uid' => $set['uid'], 'allow_cid' => $permission,
                                                'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => ''];
-                                       DBA::insert('permissionset', $fields);
+                                       DBA::insert('permissionset', $fields, Database::INSERT_IGNORE);
                                }
                                DBA::close($sets);
                        }