Allow remove_column (now supported by SQLite)

未关闭
#7 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
julia, sqlite
领域
databases

调研方向

从 SearchLight.Migration.remove_column 入口点开始,结合 issue 中链接的 SQLite ALTER TABLE DROP COLUMN 文档,检查它如何使用 SearchLight.query。完成标准是 SQLite 适配器支持删除列,并适当地处理相关的数据库失败;issue 中未指定测试文件。

由索引模型根据 Issue 内容生成。

描述

From what I see, SQLite now supports ALTER TABLE DROP COLUMN: https://sqlite.org/lang_altertable.html#altertabdropcol

remove_column would probably look like this then?

function SearchLight.Migration.remove_column(table_name::Union{String,Symbol},
    name::Union{String,Symbol}, options::Union{String,Symbol} = "") :: Nothing
  SearchLight.query("ALTER TABLE `$table_name` DROP COLUMN `$name` $options")

  nothing
end

I am very new to database stuff; maybe the possible failures reasons (like column being unique, or an index) should be checked in the function?

主要语言
Julia
星标
3
派生
4
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。