<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 70 alembic常用命令和經典錯誤解決辦法 續上... 7.命令和參數解釋: * init:創建一個alembic倉庫 * revision:創建一個新的版本文件 * --autogenerate:自動將當前模型的修改,生成遷移腳本 * -m:本次遷移做了哪些修改,用戶可以指定這個參數,方便回顧 * upgrade:將指定版本的遷移文檔映射到數據庫中,會執行版本文檔中的upgrade函數 * head:代表當前的遷移腳本的版本號 * downgrade:會執行指定版本的遷移文檔中的downgrade函數 * heads:展示當前可用的heads腳本文檔 * history:列出所有的遷移版本及其信息 * current:展示當前數據庫中的版本號 另外,在第一次執行的upgrade的時候,就會在數據庫中創建一個alembic\_version表,這個表只會有一條數據,記錄當前數據庫映射的是哪個版本的遷移文件 ## 經典錯誤: | 錯誤描述 | 原因 | 解決辦法 | | :--- | :--- | :--- | | FAILED:Target databases is not up to date | 主要是heads和current不相同。current落后于heads的版本 | 將current移動到head上。alembic upgrade head | | FAILED:can't locate revision identified by 'xxxxx' | 數據庫中存的版本號不在遷移腳本文檔中 | 刪除數據的alembic\_version表中的數據,重新執行alembic upgrade head | ```text # head 代表最新版本的遷移腳本的版本號 alembic upgrade Revision ID 把數據映射到數據庫中 alembic upgrade head # 查看Revision ID alembic heads # 查看當前版本號 alembic current # 更新字段/添加字段 alembic revision --autogenerate -m "add country column" # 執行 alembic upgrade head # 刪除字段 alembic revision --autogenerate -m "delete contry column" alembic upgrade head # 查看所有歷史消息 alembic history # 降級 將數據庫降級到最初版本 alembic downgrade base 將數據庫降級到執行版本,使用alembic downgrade+版本號 alembic downgrade <version> ```
                  <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>

                              哎呀哎呀视频在线观看