mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
Move 'addon' table into config
This commit is contained in:
parent
6c033c9bd1
commit
cd11088cc4
4 changed files with 22 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
-- ------------------------------------------
|
||||
-- Friendica 2023.03-dev (Giant Rhubarb)
|
||||
-- DB_UPDATE_VERSION 1508
|
||||
-- DB_UPDATE_VERSION 1509
|
||||
-- ------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -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', 'config', 'addon'];
|
||||
|
||||
$tables = DBA::selectToArray('INFORMATION_SCHEMA.TABLES', ['TABLE_NAME'],
|
||||
['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']);
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
use Friendica\Database\DBA;
|
||||
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1508);
|
||||
define('DB_UPDATE_VERSION', 1509);
|
||||
}
|
||||
|
||||
return [
|
||||
|
|
20
update.php
20
update.php
|
@ -1192,5 +1192,23 @@ function update_1508()
|
|||
|
||||
$newConfig->commit();
|
||||
|
||||
DBA::e("TRUNCATE TABLE `config`");
|
||||
return DBA::e("TRUNCATE TABLE `config`") ? Update::SUCCESS : Update::FAILED;
|
||||
}
|
||||
|
||||
function update_1509()
|
||||
{
|
||||
$addons = DBA::selectToArray('addon');
|
||||
|
||||
$newConfig = DI::config()->beginTransaction();
|
||||
|
||||
foreach ($addons as $addon) {
|
||||
$newConfig->set('addons', $addon['name'], [
|
||||
'last_update' => $addon['timestamp'],
|
||||
'admin' => (bool)$addon['plugin_admin'],
|
||||
]);
|
||||
}
|
||||
|
||||
$newConfig->commit();
|
||||
|
||||
return DBA::e("TRUNCATE TABLE `addon`") ? Update::SUCCESS : Update::FAILED;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue