public function _buildBackupTable($table) { $db = new PHPWS_DB($table); $result = $db->getTableColumns(TRUE); foreach ($result as $col) { if ($col['name'] == 'id') { continue; } $allColumns[] = $col; } $columns = PHPWS_DB::parseColumns($allColumns); $columns[] = 'backup_id int NOT NULL'; $columns[] = 'backup_order smallint NOT NULL'; $sql = 'CREATE TABLE ' . Backup::getBackupTableName($table) . ' (' . implode(', ', $columns) . ')'; return PHPWS_DB::query($sql); }