Closed geoidesic closed 4 years ago
You need to wrap your JsonApiRoutes
in a try...catch (I guess it could do that internally). JsonApiRoutes
instantiates your table objects in order to generate all routes, so if the database table doesn't exist yet, it would break.
If I change my migration script (which I run with the --no-lock switch btw, as the app is pre-production) and then drop all tables, then try to run
bin/cake migrations migrate --no-lock
, it won't work. I get this error:If I then comment out the JsonApi routes, i.e. this line:
JsonApiRoutes::mapModels($this->resources, $routes);
the error goes away.Any idea what's going on?