2009-07-25 57 views

回答

5

這是正常現象。

更新模型/表格/過濾器等等,您可以運行

./symfony doctrine:build-all 

任務。

在開發過程中,您可能正在將數據載入您的數據庫,因此會加載doctrine:data-load(或使用build-all-reload任務)。

但是,一旦您的應用程序在生產中,您顯然不希望在每次更改數據庫架構時都拋棄所有數據。這是遷移進來

我的過程是:

  • 更新的schema.yml
  • 運行學說:集結在所有的開發環境。
  • 創建遷移
  • 在開發環境中執行任何開發/測試。
  • 將代碼部署到生產
  • 將遷移應用到生產數據庫。
+0

好的,理解。非常感謝你! – miguelSantirso 2009-07-27 09:30:35

0

從PHP symfony的1.4 PHP symfony的學說:建立幫助菜單

You must include one or more of the following build options:  

--all,--all類,--model,--forms,--filters,--sql ,--db

的詳細信息,請參閱該任務的幫助頁面:

php symfony help doctrine:build 

你可以更細粒度的這個只有建立--model --forms --filters等等

如果您構建所有數據庫,您將丟失數據庫中的所有數據,因爲它會重建數據庫。