Use comments to show when fixtures were used
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- postgresql, sql, typescript
调研方向
使用 issue 中的 current.sql、fixtures/functions/hello.sql 和生成的 000001.sql 示例,追踪 fixture 包含和迁移转换的入口点。比较已提交的输出和未迁移的输出,然后验证源自 fixture 的 SQL 是否带有注释,用于标识所包含的 fixture 及其边界。
由索引模型根据 Issue 内容生成。
描述
Feature description
In experimenting with the new fixture feature, I noticed that:
- There is no way to tell in the committed migration that a fixture was used.
- When uncommitting a migration that used a fixture, the fixture contents are inlined back into the migration
It seems like it would be useful to include some comments that indicate it came from a fixture. Maybe something like
current.sql:
select 'foo';
--! include functions/hello.sql
fixtures/functions/hello.sql
create or replace function public.hello() returns text as $$
select 'Hello, world!';
$$ language sql;
translating into 000001.sql
--! Previous: -
--! Hash: sha1:a62f7d32702b880992ad9e2a7753dd977267064a
select 'foo';
--! Included: functions/hello.sql
create or replace function public.hello() returns text as $$
select 'Hello, world!';
$$ language sql;
--! EndIncluded
I'm not deeply familiar with naming conventions of the !-- comments, so of course feel free to suggest better names
Motivating example
I was messing around with the new fixture features and was curious how it handled unmigrations. Admittedly, unmigrating is not a common thing I do, so it's not a huge deal. But as I thought about it, I came to think that even including a comment in the final migration that the statements came from a fixture is a positive addition to help future readers of migrations understand how the migrations were written.
Breaking changes
It seems like a change like this would only affect migrations going forward, so hopefully no breaking changes for anyone who is already on the 2.0 release candidates.
Supporting development
I:
- am interested in building this feature myself
- am interested in collaborating on building this feature
- am willing to help testing this feature before it's released
- am willing to write a test-driven test suite for this feature (before it exists)
- am a Graphile sponsor ❤️ (Just at the "backer" level)
- have an active support or consultancy contract with Graphile
- 主要语言
- TypeScript
- 星标
- 836
- 派生
- 71
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphile/migrate 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 35/100
-
🐛 bug
难度 3/5 1-2 天 新手友好度 42/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
rel: fix
难度 2/5 1-3 小时 新手友好度 68/100
Deltares/fews-web-oc#2400 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
ardia-browser/ardia#4426 ·
维护者通常 1 天内回复
-
Bug report: isValidISODateDashOnly accepts text before or after the date-time可能已有人在做 @bardrop 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
pnp/cli-microsoft365#7713 ·
维护者通常 1 天内回复
-
Diagram: Journey Type: Bug / Error
难度 2/5 1-3 小时 新手友好度 62/100
mermaid-js/mermaid-v13#1293 ·
维护者通常 1 天内回复