Closed chao closed 5 years ago
This check is in place to ensure the service isn't booted if the migration hasn't run yet to create the base table. An issue arose in the past where a new project include totem and had immediate failures as the migrations weren't run. We should be able to wrap that check with some caching to reduce that select overhead.
Yes, if the table wasn't correctly created, an exception will be thrown in ConsoleServiceProvider
, right?
Maybe you can just wrap the following code with try... catch...
:
$tasks = app('totem.tasks')->findAllActive();
@chao See PR 131
Our DB operator noticed there is tons of query on information_schema.tables (
SELECT * FROM information_schema.tables WHERE table_schema=? and table_name='tasks'
) which are caused by laravel-totem.After digging the code, in the
TotemServiceProvider.php
you check the 'tasks' table existence every time. Is this really necessary?