Changes between Version 17 and Version 18 of SqLiteToMySql
- Timestamp:
- Feb 16, 2012, 7:38:05 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SqLiteToMySql
v17 v18 127 127 None of the scripts here deal with quoting of ' characters caused by sqlite/mysql differences. Here is my perl script for sqlite to mysql migrate, which handles quoting very accurately: 128 128 {{{ 129 print << 'EOF'; 130 BEGIN; 131 TRUNCATE `attachment` ; 132 TRUNCATE `auth_cookie` ; 133 -- ############ more truncates here... 134 EOF 135 136 $inq=0; 137 $del=0; 129 print "BEGIN;\n"; 130 print "TRUNCATE `$_`;\n" for (qw(attachment auth_cookie cache component enum milestone node_change permission report 131 repository revision session session_attribute system ticket ticket_change ticket_custom version wiki)); 132 my ($inq,$del); 138 133 sub qut { local $_=shift; ($inq ? (/'/ ? "\\" : ($inq=0,"'")) : "'".(/'/ ? '' : ($inq=1,''))).$_ } 139 140 134 while (<>) { 141 135 $del=!/;/, next if ($del); … … 148 142 print; 149 143 } 150 print "COMMIT; "144 print "COMMIT;\n" 151 145 }}}