我做到了,但它没有用。
我建立:
推进.schema.xml
推进模式.yml
# config/propel.schema.yml
propel:
article:
id: ~
另一个数据库配置是
orgdb.schema.xml
<?xml version="1.0" encoding="UTF-8"?>
<database name="orgdb" defaultIdMethod="native" noXsd="true" package="lib.model">
<table name="organization">
<column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true"/>
orgdb.schema.yml
# config/orgdb.schema.yml
orgdb:
organization:
id: ~
在数据库.yml
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/07-Databases
dev:
propel:
param:
classname: DebugPDO
debug:
realmemoryusage: true
details:
time: { enabled: true }
slow: { enabled: true, threshold: 0.1 }
mem: { enabled: true }
mempeak: { enabled: true }
memdelta: { enabled: true }
test:
propel:
param:
classname: DebugPDO
all:
propel:
class: sfPropelDatabase
param:
classname: PropelPDO
dsn: mysql:dbname=db1;host=localhost
username:
password:
encoding: utf8
persistent: true
pooling: true
orgdb:
class: sfPropelDatabase
param:
classname: PropelPDO
dsn: mysql:dbname=db2;host=localhost
username:
password:
encoding: utf8
persistent: true
pooling: true
我称这个命令为:
php symfony propel:build-model
当我进入网站时我看到错误,我没有问题购买
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db1.organization' doesn't exist
当我调用这个命令时:
php symfony propel:build --all
cmd中的错误是
Fatal error: Call to a member function addTable() on a non-object in C:\PHP...\lib\vendor\symfony\lib\plugins\sfpropelPlugin\lib\vendor\propel-generator\classes\propel\phing\PropelSQLTask.php on line 237
任何想法?
谢谢