<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ci-cd on </title>
    <link>/tags/ci-cd/</link>
    <description>Recent content in ci-cd on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 26 Apr 2026 10:00:00 +0800</lastBuildDate><atom:link href="/tags/ci-cd/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Liquibase (XML) 在微服务里的实践记录：一份问答式整理</title>
      <link>/posts/best-practice-for-liquibase/</link>
      <pubDate>Sun, 26 Apr 2026 10:00:00 +0800</pubDate>
      
      <guid>/posts/best-practice-for-liquibase/</guid>
      <description>本文用一组「问答」拆解 Liquibase（XML 格式）在 Spring Boot 微服务下我更倾向采用的一些实践经验。文中的反例都来自真实可见的代码风格——表名、字段、author 全部脱敏，不指向任何具体项目。每条做法尽量给出官方文档或社区可访问的来源。
一、Schema 应该住在哪个 repo？ Q：为什么我现在不太倾向继续用一个独立的 db-* 仓库（或子模块）单独保存所有 MS 的 schema？
历史上常见的做法是开一个 database-foo、database-bar 的项目，里面只放 liquibase.properties + 一堆 change-log/*.xml，跑 mvn liquibase:update 完成迁移。问题是：
schema 和服务代码不在同一个生命周期里。MS 加了一个 entity_id 字段，PR 在服务 repo；migration 在另一个 repo。两个 PR 难以原子合并，code review 也只能看半边。 CI 触发不一致。服务 repo 的测试不会跑 migration repo 的最新变更；migration repo 的 CI 也很难拿到服务的 entity 类去做 schema-vs-entity 的 sanity check。 不利于 service ownership。微服务的核心原则是 database per service；schema 是这个服务的私有资产，住到外部 repo 等同于把私有资产挪出了边界。 Q：那我现在更倾向怎么放？
直接放进微服务自己的 repo，使用 Spring Boot 默认约定：</description>
    </item>
    
  </channel>
</rss>
