2016-12-03 12 views
1

毎回、誰かが解決策を得ていますか?オラクルテーブルでベークトラブルが発生したCakePHP 3

Exception: Columns used in constraints must be added to the Table schema first. The column "region_id" was not found in table "COUNTRIES". in [C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Table.php, line 606] 
 
2016-12-03 06:47:03 Error: [Cake\Database\Exception] Columns used in constraints must be added to the Table schema first. The column "region_id" was not found in table "COUNTRIES". 
 
Stack Trace: 
 
#0 C:\xampp\htdocs\production\vendor\cakedc\cakephp-oracle-driver\src\Database\Schema\OracleSchema.php(623): Cake\Database\Schema\Table->addConstraint('COUNTR_REG_FK', Array) 
 
#1 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Collection.php(134): CakeDC\OracleDriver\Database\Schema\OracleSchema->convertForeignKeyDescription(Object(Cake\Database\Schema\Table), Array) 
 
#2 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\Collection.php(103): Cake\Database\Schema\Collection->_reflect('ForeignKey', 'COUNTRIES', Array, Object(Cake\Database\Schema\Table)) 
 
#3 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Database\Schema\CachedCollection.php(63): Cake\Database\Schema\Collection->describe('COUNTRIES', Array) 
 
#4 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\ORM\Table.php(440): Cake\Database\Schema\CachedCollection->describe('COUNTRIES') 
 
#5 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(345): Cake\ORM\Table->schema() 
 
#6 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(221): Bake\Shell\Task\ModelTask->findHasMany(Object(Cake\ORM\Table), Array) 
 
#7 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(127): Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table)) 
 
#8 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(110): Bake\Shell\Task\ModelTask->getTableContext(Object(Cake\ORM\Table), 'users', 'Users') 
 
#9 C:\xampp\htdocs\production\vendor\cakephp\bake\src\Shell\Task\ModelTask.php(97): Bake\Shell\Task\ModelTask->bake('Users') 
 
#10 [internal function]: Bake\Shell\Task\ModelTask->main('users') 
 
#11 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\Shell.php(466): call_user_func_array(Array, Array) 
 
#12 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\Shell.php(459): Cake\Console\Shell->runCommand(Array, false, Array) 
 
#13 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(227): Cake\Console\Shell->runCommand(Array, true, Array) 
 
#14 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(182): Cake\Console\ShellDispatcher->_dispatch(Array) 
 
#15 C:\xampp\htdocs\production\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(128): Cake\Console\ShellDispatcher->dispatch(Array) 
 
#16 C:\xampp\htdocs\production\bin\cake.php(34): Cake\Console\ShellDispatcher::run(Array) 
 
#17 {main}

+0

国のテーブルにregion_idがありますが、私が足場(ケーキベーク)をしようとしているときにこの問題が発生しました –

+0

あなたが見ているものを誰かが再現できるように質問に関連するテーブルのスキーマを追加してください。 – AD7six

答えて

0

問題は、ちょうどCakePHPはそのようにサポートする原因と、 "SEQUENCE" の命名規則を修正する必要が解決されています。以下の例

テーブル名が "users"の場合、sequnus名は "seq_users"になります。

関連する問題