知识卡片
已执行迁移保持不可变
已执行迁移记录了环境达到某状态的历史,不应回头修改或删除以重写过去。后来发现字段不需要,应追加新的迁移,使不同环境都能沿同一历史到达目标状态。否则已有环境与新建环境会出现结构分歧,中间版本也难以重现。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Evolutionary Data · 查看原书依据
Once developers have run migrations, the migrations are considered immutable—changes are modeled after double-entry bookkeeping. For example, suppose that Danielle the developer ran the migration in Example 6-2 as the 24th migration on a project. Later, she realizes dateofbirth isn’t needed after all. She could just remove the 24th migration, and hence, the dateofbirth column. However, any code written after Danielle ran the migration will
参考来源
- 位置:《Building Evolutionary Architectures Automated Software Governance, 2nd Edition》第06章《Evolutionary Data》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Evolutionary Architectures Automated Software Governance, 2nd Edition/_epub-src/OEBPS/ch06.html;段落定位:Once developers have run migrations)
- 结论依据:原文对“已执行迁移保持不可变”的定义或案例,支撑“已执行迁移记录了环境达到某状态的历史,不应回头修改或删除以重写过去”的归纳。据其上下文,后来发现字段不需要,应追加新的迁移,使不同环境都能沿同一历史到达目标状态。
- 原始内容:Once developers have run migrations, the migrations are considered immutable—changes are modeled after double-entry bookkeeping. For example, suppose that Danielle the developer ran the migration in Example 6-2 as the 24th migration on a project. Later, she realizes dateofbirth isn’t needed after all. She could just remove the 24th migration, and hence, the dateofbirth column. However, any code written after Danielle ran the migration will