久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='JVDH1'><style id='JVDH1'><dir id='JVDH1'><q id='JVDH1'></q></dir></style></legend>

          <bdo id='JVDH1'></bdo><ul id='JVDH1'></ul>
        <tfoot id='JVDH1'></tfoot>

        <small id='JVDH1'></small><noframes id='JVDH1'>

      1. <i id='JVDH1'><tr id='JVDH1'><dt id='JVDH1'><q id='JVDH1'><span id='JVDH1'><b id='JVDH1'><form id='JVDH1'><ins id='JVDH1'></ins><ul id='JVDH1'></ul><sub id='JVDH1'></sub></form><legend id='JVDH1'></legend><bdo id='JVDH1'><pre id='JVDH1'><center id='JVDH1'></center></pre></bdo></b><th id='JVDH1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JVDH1'><tfoot id='JVDH1'></tfoot><dl id='JVDH1'><fieldset id='JVDH1'></fieldset></dl></div>
      2. 軟刪除最佳實踐(PHP/MySQL)

        Soft delete best practices (PHP/MySQL)(軟刪除最佳實踐(PHP/MySQL))

        <small id='btmC9'></small><noframes id='btmC9'>

            <tbody id='btmC9'></tbody>

              <tfoot id='btmC9'></tfoot>
              <legend id='btmC9'><style id='btmC9'><dir id='btmC9'><q id='btmC9'></q></dir></style></legend>

                <i id='btmC9'><tr id='btmC9'><dt id='btmC9'><q id='btmC9'><span id='btmC9'><b id='btmC9'><form id='btmC9'><ins id='btmC9'></ins><ul id='btmC9'></ul><sub id='btmC9'></sub></form><legend id='btmC9'></legend><bdo id='btmC9'><pre id='btmC9'><center id='btmC9'></center></pre></bdo></b><th id='btmC9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='btmC9'><tfoot id='btmC9'></tfoot><dl id='btmC9'><fieldset id='btmC9'></fieldset></dl></div>
                  <bdo id='btmC9'></bdo><ul id='btmC9'></ul>
                • 本文介紹了軟刪除最佳實踐(PHP/MySQL)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  問題

                  在處理產品和訂單的 Web 應用程序中,我想維護前雇員(用戶)與他們處理的訂單之間的信息和關系.我想維護過時產品和包含這些產品的訂單之間的信息和關系.

                  In a web application dealing with products and orders, I want to maintain information and relationships between former employees (users) and the orders they handled. I want to maintain information and relationships between obsolete products and orders which include these products.

                  但是我希望員工能夠清理管理界面,例如刪除前員工、過時的產品、過時的產品組等.

                  However I want employees to be able to de-clutter the administration interfaces, such as removing former employees, obsolete products, obsolete product groups etc.

                  我正在考慮實施軟刪除.那么,人們通常如何做到這一點?

                  I'm thinking of implementing soft-deletion. So, how does one usually do this?

                  我的即時想法

                  我的第一個想法是在每個應該軟刪除的對象表中粘貼一個flag_softdeleted TINYINT NOT NULL DEFAULT 0"列.或者可以改用時間戳?

                  My first thought is to stick a "flag_softdeleted TINYINT NOT NULL DEFAULT 0" column in every table of objects that should be soft deletable. Or maybe use a timestamp instead?

                  然后,我在每個相關的 GUI 中提供一個顯示已刪除"或取消刪除"按鈕.單擊此按鈕,您將在結果中包含軟刪除的記錄.每個刪除的記錄都有一個恢復"按鈕.這有意義嗎?

                  Then, I provide a "Show deleted" or "Undelete" button in each relevant GUI. Clicking this button you will include soft-deleted records in the result. Each deleted record has a "Restore" button. Does this make sense?

                  你的想法?

                  此外,如果您提供任何相關資源的鏈接,我將不勝感激.

                  Also, I'd appreciate any links to relevant resources.

                  推薦答案

                  我就是這樣做的.我有一個 is_deleted 字段,默認為 0.然后查詢只需檢查 WHERE is_deleted = 0.

                  That's how I do it. I have a is_deleted field which defaults to 0. Then queries just check WHERE is_deleted = 0.

                  我盡量遠離任何硬刪除.有時它們是必要的,但我將其設為僅限管理員的功能.這樣我們可以硬刪除,但用戶不能...

                  I try to stay away from any hard-deletes as much as possible. They are necessary sometimes, but I make that an admin-only feature. That way we can hard-delete, but users can't...

                  實際上,您可以使用它在您的應用程序中使用多個層"軟刪除.所以每個都可以是一個代碼:

                  In fact, you could use this to have multiple "layers" of soft-deletion in your app. So each could be a code:

                  • 0 -> 未刪除
                  • 1 -> 軟刪除,顯示在管理用戶的已刪除項目列表中
                  • 2 -> 軟刪除,除管理員用戶外不顯示任何用戶
                  • 3 -> 僅對開發者顯示.
                  • 0 -> Not Deleted
                  • 1 -> Soft Deleted, shows up in lists of deleted items for management users
                  • 2 -> Soft Deleted, does not show up for any user except admin users
                  • 3 -> Only shows up for developers.

                  擁有其他 2 個級別仍然允許經理和管理員在刪除列表太長時清理它們.而且由于前端代碼只檢查 is_deleted = 0,它對前端是透明的...

                  Having the other 2 levels will still allow managers and admins to clean up the deleted lists if they get too long. And since the front-end code just checks for is_deleted = 0, it's transparent to the frontend...

                  這篇關于軟刪除最佳實踐(PHP/MySQL)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                      • <bdo id='hoVEf'></bdo><ul id='hoVEf'></ul>

                        <tfoot id='hoVEf'></tfoot>

                        <i id='hoVEf'><tr id='hoVEf'><dt id='hoVEf'><q id='hoVEf'><span id='hoVEf'><b id='hoVEf'><form id='hoVEf'><ins id='hoVEf'></ins><ul id='hoVEf'></ul><sub id='hoVEf'></sub></form><legend id='hoVEf'></legend><bdo id='hoVEf'><pre id='hoVEf'><center id='hoVEf'></center></pre></bdo></b><th id='hoVEf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hoVEf'><tfoot id='hoVEf'></tfoot><dl id='hoVEf'><fieldset id='hoVEf'></fieldset></dl></div>

                      • <legend id='hoVEf'><style id='hoVEf'><dir id='hoVEf'><q id='hoVEf'></q></dir></style></legend>

                        <small id='hoVEf'></small><noframes id='hoVEf'>

                            <tbody id='hoVEf'></tbody>
                            主站蜘蛛池模板: 日韩一区二区三区在线视频 | 午夜专区 | 一区二区三区av夏目彩春 | 久草.com | 亚洲精品456| 国产精品美女一区二区 | 资源首页二三区 | 国产一区二区欧美 | 国产一级片精品 | 久久久久国产一区二区三区四区 | 成人影院网站ww555久久精品 | 亚洲成人在线网 | 精品国产精品国产偷麻豆 | 欧美日韩综合一区 | 91久久电影 | 青久草视频 | 亚洲一区二区三区视频 | 99成人精品 | 日本亚洲欧美 | 欧美日韩在线综合 | av超碰 | 在线国产一区二区 | 亚洲精品黄 | 一区精品视频 | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 综合久久久久久久 | 91精品久久久久久久久久 | 免费国产成人av | 中文字幕亚洲一区 | 影音先锋亚洲资源 | 国产乱码精品一区二区三区忘忧草 | 久久中文视频 | 欧美精品二区 | 久久久涩 | 黄色在线观看网站 | 老妇激情毛片免费 | 久久久性色精品国产免费观看 | 久久精品国产99国产精品 | www.婷婷| 国产片网站| 久久国产精99精产国高潮 |