if ActiveRecord::Base.connection.tables.include?('kms_templates')
          Template.all.each do |template|
            Kms.template_manager.register_layout(template.register_id, template.content || "", Kms::ExternalsRegistry.externals.keys)