hanami db prepare fails with no migrations, breaking bin/setup in new apps

未关闭 适合新手
#485 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
ruby
领域
cli, database

调研方向

首先定位 Database#schema_migrations_sql_dump,并追踪新应用尚未应用任何迁移时 hanami db prepare 使用的代码路径。将这种情况与现有的无迁移目录行为进行比较。当已应用迁移集合为空时,该方法返回 nil,且 bin/setup 加载结构时不再失败,即为完成。

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

描述

In a new app, bin/setup fails at hanami db prepare:

hanami new bookshelf && cd bookshelf && bin/setup

INSERT INTO schema_migrations (filename) VALUES ;
                                  error here ---^
!!! => "db/bookshelf_test.sqlite structure loaded from config/db/structure.sql" FAILED

With no migrations applied, Database#schema_migrations_sql_dump writes an INSERT with no values. It should return nil when there are no applied migrations, as it already does when there is no migrations directory.

Also a bug in 3.0.

主要语言
Ruby
星标
33
派生
57
平均合并
1 天 6 小时
30 天内合并 PR
9

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

hanami/hanami-cli 的其他 Issue

查看 hanami/hanami-cli 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

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