Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
namespace :cartodb do
namespace :db do
desc 'Create importer schema and assign privileges to owner'
task :create_importer_schema => :environment do
count = ::User.count
::User.all.each_with_index do |user, index|
begin
puts "Creating importer schema for #{user.username}"
user.db_service.create_importer_schema
user.db_service.set_user_privileges_in_importer_schema
printf "OK %-#{20}s (%-#{4}s/%-#{4}s)\n", user.username, index, count
rescue => exception
printf "FAIL %-#{20}s (%-#{4}s/%-#{4}s) #{exception.message}\n", user.username, index, count
end
sleep(1.0/5.0)
end
end
end
end