Skip to content
代码片段 群组 项目
提交 9733087a 编辑于 作者: Tianwen Chen's avatar Tianwen Chen
浏览文件

Allow to regenerate the schema from the beginning by loading init schema

Changelog: added
上级 e2a85110
No related branches found
No related tags found
无相关合并请求
......@@ -32,6 +32,7 @@ class SchemaRegenerator
def initialize(options)
@rollback_testing = options.delete(:rollback_testing)
@init_schema_loading = options.delete(:init_schema_loading)
end
def execute
......@@ -195,7 +196,7 @@ class SchemaRegenerator
##
# Run rake task to setup the database.
def setup_db
run_rake_task 'db:setup'
run_rake_task(@init_schema_loading ? 'db:create' : 'db:setup')
end
##
......@@ -293,6 +294,11 @@ if $PROGRAM_NAME == __FILE__
options[:rollback_testing] = true
end
opts.on("-i", "--init-schema-loading", String,
"Enable clean migrations starting from the beginning - loading init_structure.sql") do
options[:init_schema_loading] = true
end
opts.on("-h", "--help", "Prints this help") do
puts opts
exit
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册