2014-06-18 22 views
0

我得到一個錯誤,沒有可用的連接,而這樣做的Propel:對於MyProject的數據庫

$ ./propel model:build --verbose 
Processing: schema.xml 
    1 tables processed successfully 
1 tables found in 1 schema files. 
Generating PHP files... 
Datamodel: ./schema.xml 
- Database: myproject 
    + Table: resource 
     -> (unchanged) /Base/Resource.php 
     -> (unchanged) /Map/ResourceTableMap.php 
     -> (unchanged) /Base/ResourceQuery.php 
     -> (exists) Resource.php 
     -> (exists) ResourceQuery.php 
       (no change) 
Object model generation complete - All files already up to date 
$ ./propel sql:build --verbose 
Processing: schema.xml 
    1 tables processed successfully 
1 tables found in 1 schema files. 
$ ./propel sql:insert --verbose 
No connection available for myproject database 
$ 

輸出是:

No connection available for myproject database

這裏是我感興趣的3個文件:

build.properties

runtime-conf.xml

schema.xml

我缺少什麼?

謝謝。

回答

1

你可能在你的build.properties缺少這些:

propel.runtime.conf.file = runtime-conf.xml 
propel.buildtime.conf.file = buildtime-conf.xml 

構建時-conf.xml中非常相似,你運行時conf.xml中,所以你可以複製,重命名並看看它是否有效。

+0

謝謝,它的工作。文檔中提到了哪些地方?除了http://propelorm.org/reference/buildtime-configuration作爲一個小提示? –

+0

你會發現它[這裏](http://propelorm.org/reference/buildtime-configuration#directories-and-filenames) –

+0

我看到了。它描述了要使用的buildtime config文件名,並提到如果我使用多個數據庫,則需要buildtime-conf.xml。我只用一個。我只是說這個文檔有點不清楚。 –

相關問題