20_230_601, ); /** * Domains constructor. * * @access public * @since 2.0.0 * @return void */ public function __construct() { parent::__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, blog_id bigint(20) NOT NULL, domain varchar(191) NOT NULL, active tinyint(4) default 1, primary_domain tinyint(4) default 0, secure tinyint(4) default 0, stage enum('checking-dns', 'checking-ssl-cert', 'done', 'failed', 'done-without-ssl') DEFAULT 'checking-dns', date_created datetime NULL, date_modified datetime NULL, PRIMARY KEY (id), KEY blog_id (blog_id,domain,active), KEY domain (domain)"; } /** * Fixes the datetime columns to accept null. * * @since 2.1.2 */ protected function __20230601(): bool { $null_columns = array( 'date_created', 'date_modified', ); 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; } } return true; } }