4 * Copyright 2011 Roland Mas
6 * This file is part of FusionForge. FusionForge is free software;
7 * you can redistribute it and/or modify it under the terms of the
8 * GNU General Public License as published by the Free Software
9 * Foundation; either version 2 of the Licence, or (at your option)
12 * FusionForge is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 require_once (dirname(__FILE__).'/../common/include/sqlparser.php');
27 foreach (parse_sql_file($file) as $q) {
29 $q = preg_replace('/\s+/', ' ', $q);
31 if (preg_match("/^INSERT INTO /", $q)) continue ;
33 if (preg_match('/^COMMENT/', $q)) continue;
34 if (preg_match('/^SET/', $q)) continue;
35 if (preg_match('/^\\\connect/', $q)) continue;
36 if (preg_match('/^SELECT pg_catalog.setval/', $q)) continue;
38 $ignored_insert_tables = array('artifact_extra_field_elements',
39 'artifact_extra_field_list',
42 'database_startpoint',
61 foreach ($ignored_insert_tables as $i) {
62 if (preg_match("/INSERT INTO \"$i\" /", $q)) continue 2;
70 foreach ($queries as $q) {