【问题标题】:What is the right way to remove a stored procedure in liquibase在 liquibase 中删除存储过程的正确方法是什么
【发布时间】:2021-11-21 05:54:42
【问题描述】:

我有一个带有 liquibase 文件夹结构的 Spring Boot 应用程序,如下所示。

db/
├─ changes/
│  ├─ sql/
│  │  ├─ prc_existing_to_be_deleted.sql
│  │  ├─ prc_newly_added.sql
│  ├─ stored-procs-changelog.xml
├─ changelog.xml
  • changelog.xml 用于存储 liquibase 中的所有更改
  • stored-procs-changelog.xml 用于存储存储过程更改日志
  • prc_existing_to_be_deleted.sql 已经存在的存储过程
  • prc_newly_added.sql即将新增的存储过程。

我的问题是 - liquibase 是否会自动删除 prc_existing_to_be_deleted.sql 中的存储过程并在我删除文件并重新运行应用程序后更新其表并且一切都很好?如果不是,那么删除该文件中的存储过程的正确方法是什么。

【问题讨论】:

    标签: mysql spring-boot stored-procedures liquibase


    【解决方案1】:

    不,如果您只是使用 changeSets 删除文件,Liquibase 不会删除任何内容。

    如果你想以某种方式改变你的数据库,你需要为它写一个相应的changeSet。

    如果我们谈论的是程序,则有一个 dropProcedure 更改。查看文档和示例here

    【讨论】:

      猜你喜欢
      • 2015-10-22
      • 2011-12-03
      • 2013-10-16
      • 2011-03-24
      • 2017-05-29
      • 1970-01-01
      • 2011-12-26
      • 2015-07-27
      • 2013-08-06
      相关资源
      最近更新 更多