Create roles right before importing dump

pull/13526/head
Alex Martín 7 years ago
parent 257a64fdc1
commit e663526fa0

@ -426,6 +426,11 @@ module CartoDB
# in the old database while the process is ongoing
# Disabling it may be hard. Maybe it's easier to just exclude it in the export.
def import_pgdump(dump)
@logger.info("Creating roles for API Keys")
Carto::User.find(@pack_config['user']['id']).api_keys.select { |k| k.regular? }.each do |k|
k.role_creation_queries.each { |q| superuser_pg_conn.query(q) }
end
@logger.info("Importing dump from #{dump} using pg_restore..")
run_file_restore_postgres(dump, 'pre-data')
run_file_restore_postgres(dump, 'data')

Loading…
Cancel
Save