RM 1.0 SQL query to import reviews into RM

Andy.N

Well-known member
I have many pre-existing reviews which I'd like to import into Resource Manager.
Can the SQL experts (Jake specially) provide a query to import into a specific resource

Something like

insert into table xf_resource
where resource_id = 1
and reviewer_id = 1234
and date_review = mmddyyyy
and review_rating = 4.5
and review_content = "this is the content of the review"
 
I was able to come up with some way to insert old reviews into the table with minimal SQL query but I came across an issue of unique user_id.

It appears that user_id is unique so that I can't import reviews into the table and assigned it to the same user (admin in this case) because they were submitted anonymously in the past.

If I add a new review and change the user_id to 0, that review will disappear on the RM but the total count still have it.
 
Anonymous reviews are not supported.

You will have to use a unique user ID for each review.
I tried to work around this limit by editing the xf_resource_rating table directly and changing the resource_version_id to different number and so that I can use the same user_id but it failed as well.

My reasoning is that I can leave multiple reviews for the same resource, one for each version. This works for download resource but I haven't found if it's the same for fileless resource.
 
Back
Top Bottom