Skip to content
代码片段 群组 项目
提交 184a3600 编辑于 作者: Pavel Shutsin's avatar Pavel Shutsin
浏览文件

Allow migration script to accept base ref

BASE_REF variable can specify base git ref
for migration files. Common example would be
`origin/master` instead of regular `master`
上级 be25b2ca
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
......@@ -23,6 +23,9 @@
# 4. Debug mode:
# $ ruby scripts/database/migrate.rb --debug
# This will run the script with additional debug output for troubleshooting.
# 5. Custom base branch:
# $ BASE_REF=origin/master ruby scripts/database/migrate.rb
# This will run the script with origin/master as the base branch for migrations retrieval
#
# The script checks for changed migration files in both 'db/migrate' and 'db/post_migrate' directories,
# and executes the selected migrations for both the main and CI databases.
......@@ -32,7 +35,7 @@
SCRIPT_NAME = File.basename($PROGRAM_NAME)
MIGRATIONS_DIR = 'db/migrate'
POST_DEPLOY_MIGRATIONS_DIR = 'db/post_migrate'
BRANCH_NAME = 'master'
BRANCH_NAME = ENV.fetch('BASE_REF', 'master')
def require_commands!(*commands)
missing_commands = commands.reject { |command| system("command", "-v", command, out: File::NULL) }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册