GithubHelp home page GithubHelp logo

Comments (11)

markstory avatar markstory commented on May 22, 2024

How are you calling bake when you hit this error? Are you trying to bake classes for the view?

from bake.

 avatar commented on May 22, 2024

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.

markstory avatar markstory commented on May 22, 2024

By view I meant are you baking models for a database view?

from bake.

 avatar commented on May 22, 2024

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.

 avatar commented on May 22, 2024

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.

markstory avatar markstory commented on May 22, 2024

Thanks, I suspect the views are being included in the list of 'tables' when it should not be.

from bake.

markstory avatar markstory commented on May 22, 2024

Pull request up for cakephp/cakephp that fixes views being included in the list of 'tables'.

from bake.

 avatar commented on May 22, 2024

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.

lorenzo avatar lorenzo commented on May 22, 2024

@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.

 avatar commented on May 22, 2024

Thank you.

from bake.

markstory avatar markstory commented on May 22, 2024

cakephp/cakephp#6501 is the current issue for improving schema reflection on SQLServer views.

from bake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.