简体   繁体   English

Gii 模型生成器错误 - 表不存在 - Yii 框架和 SQL Server 2000

[英]Gii model generator error - Table does not exist - Yii framework and SQL Server 2000

The main configuration of the file ( main.php ) is as follows:文件( main.php )的主要配置如下:

'class'=>'CDbConnection',
'connectionString'=>'mssql:host=127.0.0.1;dbname=TestSQL'

I can connect to the database successfully, but when generating a model from Yii Code Generator it tells me that the table does not exist.我可以成功连接到数据库,但是从 Yii 代码生成器生成模型时,它告诉我该表不存在。

Table exists?表存在吗? Gii generates a model based on table. Gii 基于表生成模型。 First you need to create a table.首先,您需要创建一个表。 If you use console version gii, then to need manage console.php config.如果您使用控制台版本 gii,则需要管理 console.php 配置。

Found Solution 将表名重命名为不同的名称并使用 gii 重新生成模型,事情又开始工作了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM