Code:
BEGIN;
replace into domains (name,type) values ('225.168.192.in-addr.arpa','MASTER');
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'SOA', 'ns1.test.com. hostmaster.test.com. 2013030511 600 7200 604800 345600', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'54.225.168.192.in-addr.arpa', 'PTR', 'somedomain1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'117.225.168.192.in-addr.arpa', 'PTR', 'somedomain2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
COMMIT;
BEGIN;
replace into domains (name,type) values ('225.168.192.in-addr.arpa','MASTER');
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'SOA', 'ns1.test.com. hostmaster.test.com. 2013030511 600 7200 604800 345600', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'54.225.168.192.in-addr.arpa', 'PTR', 'somedomain1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'117.225.168.192.in-addr.arpa', 'PTR', 'somedomain2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
COMMIT;
BEGIN;
replace into domains (name,type) values ('225.168.192.in-addr.arpa','MASTER');
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'SOA', 'ns1.test.com. hostmaster.test.com. 2013030511 600 7200 604800 345600', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'225.168.192.in-addr.arpa', 'NS', 'ns2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'54.225.168.192.in-addr.arpa', 'PTR', 'somedomain1.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
replace into records (domain_id, name,type,content,ttl,prio) select id ,'117.225.168.192.in-addr.arpa', 'PTR', 'somedomain2.test.com', 86400, 0 from domains where name='225.168.192.in-addr.arpa';
COMMIT;