<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 同步和刪除模型 > 譯者:[飛龍](https://github.com/wizardforcel) > 來源:[Syncing and dropping models](https://github.com/dresende/node-orm2/wiki/Syncing-and-dropping-models) 同步是一項功能方法,可以在數據庫里為你的模型和關聯創建所需的表來工作。現存的表并不會被替換,它們只會在不存在的時候被創建。 同步有兩種方式: 1. 調用`Model.sync(cb)`會僅僅同步指定模型 2. 調用`db.sync(cb)`會同步所有模型 刪除是一個類似的方法,但是它會刪掉你模型涉及的所有表,即使不是ORM創建的。刪除也有兩種方式。 ``` var orm = require("orm"); orm.connect("....", function (err, db) { var Person = db.define("person", { name : String }); var Pet = db.define("pet", { name : String }); db.drop(function () { // 從指定模型中刪除所有表(Person和Pet) Person.sync(function () { // 為Person模型創建表 }); }); }); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看