我是很新的Yii,我已经工作了3周的Yii和Yii的帮了我很多。在同事需要在数据库中进行某些更改之前,我的应用程序运行良好。他们删除了一个名为的表,STORE_PROCESSOR
并创建了两个名为BIG_STORE_PROCESSOR
和的新表SMALL_STORE_PROCESSOR
。他们还将新列添加到表中。
问题是当我尝试使用Gii为这些新表创建模型时,Gii告诉那些表在数据库中不存在。Gii知道STORE_PROCESSOR
表仍然存在于数据库中。CActiveRecord
还不知道已添加到表中的新列。
我们正在使用Oracle 10g XE数据库和Yii 1.1.14
这是我的 config/main.php
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Portal Online Store',
'language'=>'en',
'theme'=>'default',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'bolu',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to enable URLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString'=>'oci:dbname=152.116.31.148:1521/XE;charset=UTF8',
//'emulatePrepare' => true,
'username' => 'xxxxxxxxx',
'password' => '******',
//'charset' => 'utf8',
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'[email protected]',
'timeout'=>'900',
'timezone'=>'Asia/Jakarta'
),
);
问题不在Yii中。我们是Yii的新手,也是Oracle数据库的新手。你必须更新指定的表WWW_TAB_COLUMNS
,WWW_TAB_CONS
,WWW_TABLES
中SQL developer (Oracle DB)
,一旦你改变表。如果不这样做,Yii
将不会知道数据库中的任何更改。WWW_TAB_COLUMNS
包含有关数据库中存在的所有列的信息。然后,WWW_TAB_CONS
包含有关数据库中存在的所有约束的信息。最后,WWW_TABLES
包含有关数据库中存在的所有表的信息。看起来网络应用必须先执行CRUD操作,然后才能先查看这些表
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句