<legend id='0DhSh'><style id='0DhSh'><dir id='0DhSh'><q id='0DhSh'></q></dir></style></legend>
<tfoot id='0DhSh'></tfoot>

    • <bdo id='0DhSh'></bdo><ul id='0DhSh'></ul>
    <i id='0DhSh'><tr id='0DhSh'><dt id='0DhSh'><q id='0DhSh'><span id='0DhSh'><b id='0DhSh'><form id='0DhSh'><ins id='0DhSh'></ins><ul id='0DhSh'></ul><sub id='0DhSh'></sub></form><legend id='0DhSh'></legend><bdo id='0DhSh'><pre id='0DhSh'><center id='0DhSh'></center></pre></bdo></b><th id='0DhSh'></th></span></q></dt></tr></i><div id='0DhSh'><tfoot id='0DhSh'></tfoot><dl id='0DhSh'><fieldset id='0DhSh'></fieldset></dl></div>

    <small id='0DhSh'></small><noframes id='0DhSh'>

      1. SQLite 修改列

        时间:2023-06-24
        <legend id='sr12j'><style id='sr12j'><dir id='sr12j'><q id='sr12j'></q></dir></style></legend>

              <tfoot id='sr12j'></tfoot>
                  <tbody id='sr12j'></tbody>

                  <bdo id='sr12j'></bdo><ul id='sr12j'></ul>

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

                • <i id='sr12j'><tr id='sr12j'><dt id='sr12j'><q id='sr12j'><span id='sr12j'><b id='sr12j'><form id='sr12j'><ins id='sr12j'></ins><ul id='sr12j'></ul><sub id='sr12j'></sub></form><legend id='sr12j'></legend><bdo id='sr12j'><pre id='sr12j'><center id='sr12j'></center></pre></bdo></b><th id='sr12j'></th></span></q></dt></tr></i><div id='sr12j'><tfoot id='sr12j'></tfoot><dl id='sr12j'><fieldset id='sr12j'></fieldset></dl></div>
                  本文介绍了SQLite 修改列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要修改 SQLite 数据库中的一列,但由于数据库已经在生产中,我必须以编程方式进行.根据我的研究,我发现为了做到这一点,我必须执行以下操作.

                  I need to modify a column in a SQLite database but I have to do it programatically due to the database already being in production. From my research I have found that in order to do this I must do the following.

                  • 使用新架构创建一个新表
                  • 将数据从旧表复制到新表
                  • 放下旧桌子
                  • 将新表重命名为旧表名

                  对于应该相对容易的事情来说,这似乎是一项荒谬的工作.没有更简单的方法吗?我需要做的就是更改现有列的约束并为其指定默认值.

                  That seems like a ridiculous amount of work for something that should be relatively easy. Is there not an easier way? All I need to do is change a constraint on a existing column and give it a default value.

                  推荐答案

                  这是 SQLite 众所周知的缺点之一(在 ALTER TABLE 上没有 MODIFY COLUMN 支持),但它位于SQLite 未实现的 SQL 功能列表.

                  That's one of the better-known drawbacks of SQLite (no MODIFY COLUMN support on ALTER TABLE), but it's on the list of SQL features that SQLite does not implement.

                  删除了提到它可能在未来版本中受支持的位,因为页面已更新以表明不再是这种情况

                  edit: Removed bit that mentioned it may being supported in a future release as the page was updated to indicate that is no longer the case

                  这篇关于SQLite 修改列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:修改列 Vs 更改列 下一篇:将列添加到表中,然后在事务中更新它

                  相关文章

                  <i id='oPb7V'><tr id='oPb7V'><dt id='oPb7V'><q id='oPb7V'><span id='oPb7V'><b id='oPb7V'><form id='oPb7V'><ins id='oPb7V'></ins><ul id='oPb7V'></ul><sub id='oPb7V'></sub></form><legend id='oPb7V'></legend><bdo id='oPb7V'><pre id='oPb7V'><center id='oPb7V'></center></pre></bdo></b><th id='oPb7V'></th></span></q></dt></tr></i><div id='oPb7V'><tfoot id='oPb7V'></tfoot><dl id='oPb7V'><fieldset id='oPb7V'></fieldset></dl></div>
                  <legend id='oPb7V'><style id='oPb7V'><dir id='oPb7V'><q id='oPb7V'></q></dir></style></legend>
                • <small id='oPb7V'></small><noframes id='oPb7V'>

                      <bdo id='oPb7V'></bdo><ul id='oPb7V'></ul>
                  1. <tfoot id='oPb7V'></tfoot>