cakephp / orm

[READ-ONLY] A flexible, lightweight and powerful Object-Relational Mapper for PHP, implemented using the DataMapper pattern. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MS SQL Server Schemas

sdanko opened this issue · comments

CakePHP only seems to see tables from my default dbo schema on SQL Server 2012 database. When I try to bake the model for tables from other schemas I get an error saying:

Exception: Cannot describe content. It has 0 columns.

Also when I fetch the list of tables in schema using:

$collection = $db->schemaCollection();
$tables = $collection->listTables();

It only lists tables from dbo schema in the array. How do I use other schemas?

You need to make a connection for each schema in your database. The 'schema' config option allows you to change which schema you're using.

Thank you.