Skip to content

Commit eb76270

Browse files
committed
Fix. Alt sessions. Not needed column name removed.
1 parent 870008c commit eb76270

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

inc/cleantalk-updater.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,3 +1324,19 @@ function apbct_update_to_6_54_1()
13241324

13251325
$apbct->saveSettings();
13261326
}
1327+
1328+
function apbct_update_to_6_56_99()
1329+
{
1330+
global $wpdb;
1331+
$table_name = $wpdb->prefix . 'cleantalk_sessions';
1332+
$column_name = 'name';
1333+
$column_exists = $wpdb->get_results(
1334+
$wpdb->prepare(
1335+
"SHOW COLUMNS FROM `$table_name` LIKE %s",
1336+
$column_name
1337+
)
1338+
);
1339+
if ($column_exists) {
1340+
$wpdb->query("ALTER TABLE `$table_name` DROP COLUMN `$column_name`");
1341+
}
1342+
}

lib/Cleantalk/ApbctWP/UpdatePlugin/DbColumnCreator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Cleantalk\Common\Schema;
66

7+
// @ToDo implement columnDeleter method to drop columns that are not in schema anymore
78
class DbColumnCreator
89
{
910
/**

0 commit comments

Comments
 (0)