// rewrite the queries into CREATE TABLE queries for log tables:
$cols = <<<COLS
+ ,
log_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
log_conn_id INTEGER,
log_user_id INTEGER,
// so there's no need for a default timestamp and therefore we remove such default timestamps
// also eliminate the NOT NULL constraint, since we always copy and schema can change down the road)
$query = self::fixTimeStampAndNotNullSQL($query);
- $query = preg_replace("/^\) /m", "$cols\n) ", $query);
+ $query = preg_replace("/(,*\n*\) )ENGINE/m", "$cols\n) ENGINE", $query);
CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE);