Comments (11)
How are you calling bake when you hit this error? Are you trying to bake classes for the view?
from bake.
I am doing cake bake model [viewName]
Also we only use models and controllers since everything we do is rest/ajax calls to get json data back, so have a view file is not needed for us 95% of the time.
from bake.
By view I meant are you baking models for a database view?
from bake.
No i was baking a model for a Table on a MSSQL 2012 DB and the view is causing an error to occur, saying [view_name]. "it has 0 columns" . If i go to bake a model for the actual view, the same error happens as well. So to clarify, whether i'm baking a model for an actual table or a view, the same error happens which is directly related to there being a view present in the database, since I had no issues baking the same DB when it was mirrored and the views were removed from the db.
also just to add - We have a fully functional CakePHP 2.x build working off the same DB with zero issues.
hope that helps.
from bake.
First error says:
Exception: Cannot describe [view_name]. it has 0 columns in app\vendor\cakephp\cakephp\src\Database\Schema\Collection.php, line98
from bake.
Thanks, I suspect the views are being included in the list of 'tables' when it should not be.
from bake.
Pull request up for cakephp/cakephp that fixes views being included in the list of 'tables'.
from bake.
Mark,
In CakePHP 2.0 we were able to Bake models off Views, will this not be the case in 3? And if so, should we treat them as models/entities if we're creating them manually?
from bake.
@tgr0ss you can create manually, but you will need to manually specify the schema object for the table that maps to the view. We are looking into ways to improve this
from bake.
Thank you.
from bake.
cakephp/cakephp#6501 is the current issue for improving schema reflection on SQLServer views.
from bake.
Related Issues (20)
- Pending task for Cake 5
- RFC: Do not generate associations for `_id` fields if no Table object or database table present HOT 3
- Bug found in 2.8.0 - Error when baking component `Twig\Error\SyntaxError` HOT 1
- Baking Middleware should bake Middleware tests HOT 1
- `--datasource` alias to `--connection` for consistency HOT 2
- 2.x: Dirty state after tests HOT 3
- DisplayField does not fallback to `*_name` field HOT 1
- Allow passing multiple model names HOT 1
- Incorrect message when `plugins` directory not exists using bake HOT 13
- Column with *_id not generating a `belongsTo` relation anymore. HOT 2
- bake not override plugins bake template HOT 4
- Return value of Bake\Command\ModelCommand::getDisplayField() must be of the type string or null, array returned in HOT 6
- [3.x] Adaption to the new behavior of `EntityTrait::has()` HOT 5
- Wrong signature for get() in table classes HOT 2
- RFC: generics for array collections? HOT 2
- Cannot bake ControllerTest with model type other than Table HOT 9
- Application/Validation rule issues HOT 3
- Baked enum docblock wrong
- Baking snapshot with autoid HOT 5
- Bake snapshot losing structure data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bake.