mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Rake task for making api log schema
This commit is contained in:
parent
d5a824064e
commit
7b920cac2f
6 changed files with 70 additions and 13 deletions
12
lib/tasks/api_log.rake
Normal file
12
lib/tasks/api_log.rake
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace :api_log do
|
||||
namespace :schema do
|
||||
# desc 'Dump additional database schema'
|
||||
task :dump => [:environment] do
|
||||
filename = "#{Rails.root}/db/api_log_schema.rb"
|
||||
File.open(filename, 'w:utf-8') do |file|
|
||||
ActiveRecord::Base.establish_connection("api_log_#{Rails.env}")
|
||||
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue