From c1fe1373650437824b1ba8e0ce13620aea7bd7bb Mon Sep 17 00:00:00 2001 From: leogermani Date: Wed, 12 Dec 2018 15:47:48 -0200 Subject: [PATCH] add output column to bg process table --- src/migrations.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/migrations.php b/src/migrations.php index b315a86f5..6815eafb8 100644 --- a/src/migrations.php +++ b/src/migrations.php @@ -73,6 +73,19 @@ class Migrations { } + + static function add_output_column_to_bg_process() { + global $wpdb; + $table_name = $wpdb->prefix . 'tnc_bg_process'; + $column_exists = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$wpdb->prefix}tnc_bg_process' AND column_name = 'output'" ); + + if(empty($column_exists)) { + $wpdb->query(" + ALTER TABLE $table_name + ADD output longtext + "); + } + } static function init_capabilites() { $Tainacan_Capabilities = \Tainacan\Capabilities::get_instance();