20_230_601, ); /** * Event constructor. * * @access public * @since 2.0.0 * @return void */ public function __construct() { parent::__construct(); } // end __construct; /** * Setup the database schema * * @access protected * @since 2.0.0 * @return void */ protected function set_schema() { $this->schema = "id bigint(20) NOT NULL auto_increment, severity tinyint(4), initiator enum('system', 'manual'), author_id bigint(20) NOT NULL default '0', object_id bigint(20) NOT NULL default '0', object_type varchar(20) DEFAULT 'network', slug varchar(255), payload longtext, date_created datetime NULL, PRIMARY KEY (id), KEY severity (severity), KEY author_id (author_id), KEY initiator (initiator)"; } // end set_schema; /** * Fixes the datetime columns to accept null. * * @since 2.1.2 */ protected function __20230601(): bool { $null_columns = array( 'date_created', ); foreach ($null_columns as $column) { $query = "ALTER TABLE {$this->table_name} MODIFY COLUMN `{$column}` datetime DEFAULT NULL;"; $result = $this->get_db()->query($query); if (!$this->is_success($result)) { return false; } // end if; } // end foreach; return true; } // end __20230601; } // end class Events_Table;