-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get table description from database #6
Comments
Oracle's "everything is capitalized!" is clashing with Cake's auto-inflection. You can overcome this first problem by simply typing the table name in lower case, e.g.
instead of
Sadly, even when you get past that step there are still issues. I didn't use the command-line "bake" myself, so I didn't know about this issue until now. I'll see if the subsequent errors are easy to fix. |
Turns out you might not have further "bake" issues after all. |
I'm also stuck on the same problem: Cannot describe {{table}}. It has 0 columns. |
@afedchuk Did you try the suggestion above about using the lower-case version of the table name?
or
instead of
If your table name has underscores, like, say, "USER_PREFERENCES", then you can do either
or
|
It was result on ui part when I was retrieving data from database using models created and I also tried run bake and got next result: [root@base-rhel6u5x64 DEV]# bin/cake bake all usrs Welcome to CakePHP v3.1.8 Console App : src Bake All One moment while associations are detected. My app config has next db configuration: 'default' => [ |
Hmm. Are your tables actually in the AF_2101 schema? A fairly common practice I've seen, especially in large corporate databases, is to have the actual data tables in a separate schema that does not allow direct logins. If your tables are in a separate schema from your login username, then you need to either
class UsersTable extends Table
{
public function initialize(array $config)
{
$this->table('otherschema.users');
}
} |
@mbhd90 FYI, I just pushed out a release (1.0.7) that attempts to compensate for the ALL_CAPS / CamelCase discrepancy between Cake and Oracle. The "Choose a model to bake" listings should now match what Cake expects. |
Yes, tables in that schema. I'll try this solution, thanks for advice and your time. |
Update on my issue. I did everything what you proposed for me but it didn't help for me. I also tried change different versions of oracle instance client on linux and windows but nothing, only downgrading of php from 7.0.2 to 5.6.17 version helped me. Possibly some changes in php7 affected plugin. Both version of php were compiling with the same options and downloaded from official site. |
Oh, I haven't even tried testing with PHP 7. Interesting. I'll have to test that at some point. |
Found at least one little issue with PHP 7 that I've fixed. I'm not sure if it'll help your issue, @afedchuk, but if you're willing to try again with 7 I'd like to know if it helps. |
Now it seems is working fine on php7. Thank you @snelg |
One moment while associations are detected.
Exception: Cannot describe s_u_s_e_r_s. It has 0 columns. in [/var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Database/Schema/Collection.php, line 98]
2016-01-21 12:12:27 Error: [Cake\Database\Exception] Cannot describe s_u_s_e_r_s. It has 0 columns.
Stack Trace:
#0 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(64): Cake\Database\Schema\Collection->describe('s_u_s_e_r_s', Array)
#1 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/ORM/Table.php(423): Cake\Database\Schema\CachedCollection->describe('s_u_s_e_r_s')
#2 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/ORM/Table.php(499): Cake\ORM\Table->schema()
#3 /var/www/html/3.0/app-master/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(194): Cake\ORM\Table->primaryKey()
#4 /var/www/html/3.0/app-master/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(110): Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table))
#5 /var/www/html/3.0/app-master/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(96): Bake\Shell\Task\ModelTask->bake('SUSERS')
#6 /var/www/html/3.0/app-master/vendor/cakephp/bake/src/Shell/BakeShell.php(250): Bake\Shell\Task\ModelTask->main('SUSERS')
#7 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Collection/CollectionTrait.php(51): Bake\Shell\BakeShell->Bake\Shell{closure}('SUSERS', 0)
#8 /var/www/html/3.0/app-master/vendor/cakephp/bake/src/Shell/BakeShell.php(253): Cake\Collection\Collection->each(Object(Closure))
#9 [internal function]: Bake\Shell\BakeShell->all('SUSERS')
#10 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Console/Shell.php(443): call_user_func_array(Array, Array)
#11 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(212): Cake\Console\Shell->runCommand(Array, true, Array)
#12 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(179): Cake\Console\ShellDispatcher->_dispatch(Array)
#13 /var/www/html/3.0/app-master/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(126): Cake\Console\ShellDispatcher->dispatch(Array)
#14 /var/www/html/3.0/app-master/bin/cake.php(33): Cake\Console\ShellDispatcher::run(Array)
#15 {main}
The text was updated successfully, but these errors were encountered: