Jump to content
  • 0

SQL Trigger to delete all unused(havent been touched for 7 Days) Vehicles


Mitscher

Question

Hey guys,

 

I'm looking for a SQL-Trigger that is deleting all "Old" Vehicles that havent been touched for 7 Days.

 

Cuz I got a lot of vehicles up in the north which noone is using but just a very small amout of vehicles near the Coast.

 

 

Would be very nice if someone could help me!

 

 

 

Greetings

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
/* Delete all vehicles not touched in 7 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...