suppress_errors(true); try{foreach(Schema::usageRestrictions($wpdb) as $table=>$sql){if($table===\ABeCe\Booking\Infrastructure\Database\Tables::name( $wpdb, 'usage_limit_rules' )&&$wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s',$wpdb->esc_like($table)))&&in_array('counting_mode',$wpdb->get_col($wpdb->prepare('SHOW COLUMNS FROM %i',$table)),true))$sql=Schema::usageCountingMode($wpdb)[$table];dbDelta($sql);if($wpdb->last_error)throw new RuntimeException(__('ABeCe Booking database migration failed. Existing data has been retained.','abece-booking'));Schema::verify($wpdb,$table,$sql);}} finally{$wpdb->suppress_errors($previous);} } }