Commit 2781db6e authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Apply final migrations before creating backup

parent d1ed3d1c
class MigrateCiTables < ActiveRecord::Migration
def up
rename_table :application_settings, :ci_application_settings
rename_table :builds, :ci_builds
rename_table :commits, :ci_commits
rename_table :events, :ci_events
rename_table :jobs, :ci_jobs
rename_table :projects, :ci_projects
rename_table :runner_projects, :ci_runner_projects
rename_table :runners, :ci_runners
rename_table :services, :ci_services
rename_table :tags, :ci_tags
rename_table :taggings, :ci_taggings
rename_table :trigger_requests, :ci_trigger_requests
rename_table :triggers, :ci_triggers
rename_table :variables, :ci_variables
rename_table :web_hooks, :ci_web_hooks
end
end
......@@ -7,7 +7,6 @@ module Backup
ci_runner_projects ci_runners ci_services ci_tags ci_taggings ci_trigger_requests
ci_triggers ci_variables ci_web_hooks
}
TABLES.map! { |t| t.sub('ci_', '') } # hack until Kamil's migration lands
attr_reader :config, :db_dir
......
......@@ -4,6 +4,10 @@ namespace :backup do
task create: :environment do
configure_cron_mode
$progress.puts "Applying final database migrations ... ".blue
Rake::Task['db:migrate'].invoke
$progress.puts "done".green
$progress.puts "Dumping database ... ".blue
Backup::Database.new.dump
$progress.puts "done".green
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment