Revision fcf08d42 src/onedb/local/4.90.0_to_5.3.80.rb

View differences:

src/onedb/local/4.90.0_to_5.3.80.rb
261 261
    ############################################################################
262 262
    def feature_4809
263 263
        create_table(:logdb)
264
        create_table(:fed_logdb)
265

  
266
        @db.run "ALTER TABLE zone_pool RENAME TO old_zone_pool;"
267
        create_table(:zone_pool)
268

  
269
        @db.transaction do
270
            @db.fetch("SELECT * FROM old_zone_pool") do |row|
271
                doc = Nokogiri::XML(row[:body], nil, NOKOGIRI_ENCODING) { |c|
272
                    c.default_xml.noblanks
273
                }
274

  
275
                zedp = xpath(doc, "TEMPLATE/ENDPOINT")
276

  
277
                server_pool = doc.create_element "SERVER_POOL"
278
                server      = doc.create_element "SERVER"
279

  
280
                id   = doc.create_element "ID", 0
281
                name = doc.create_element "NAME", "zone_server"
282
                edp  = doc.create_element "ENDPOINT", zedp
283

  
284
                server.add_child(id)
285
                server.add_child(name)
286
                server.add_child(edp)
287

  
288
                server_pool.add_child(server)
289

  
290
                doc.root.add_child(server_pool)
291

  
292
                row[:body] = doc.root.to_s
293

  
294
                @db[:zone_pool].insert(row)
295
            end
296
        end
297

  
298
        @db.run "DROP TABLE old_zone_pool;"
299

  
300 264
    end
301 265
end

Also available in: Unified diff