mitydigital / statamic-scheduled-cache-invalidator

MIT License
1 stars 3 forks source link

SQL query failing #9

Closed SylvesterDamgaard closed 1 month ago

SylvesterDamgaard commented 1 month ago

When running the php artisan statamic:scheduled-cache-invalidator:run command i get this exception:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '09:37 ?))' at line 1 (Connection: mysql, SQL: select * from `entries` where `collection` = pages and `published` = 1 and (date(`date`) = 2024-06-06 and ((time(`date`) >= 09:37:00 and time(`date`) <= 09:37:59) or time(`date`) 09:37 ?)))

It looks like the Now scope needs the comparison paramater for it to work. src/Scopes/Now.php:34 ->orWhereTime($field, '=', $values['now']->format('H:i'));

martyf commented 1 month ago

Resolved with your own PR, thank you 🤩