00001 <?php 00002 // 00003 // Created on: <30-Jan-2004 10:37:22 dr> 00004 // 00005 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00006 // SOFTWARE NAME: eZ publish 00007 // SOFTWARE RELEASE: 3.9.x 00008 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 00009 // SOFTWARE LICENSE: GNU General Public License v2.0 00010 // NOTICE: > 00011 // This program is free software; you can redistribute it and/or 00012 // modify it under the terms of version 2.0 of the GNU General 00013 // Public License as published by the Free Software Foundation. 00014 // 00015 // This program is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU General Public License for more details. 00019 // 00020 // You should have received a copy of version 2.0 of the GNU General 00021 // Public License along with this program; if not, write to the Free 00022 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00023 // MA 02110-1301, USA. 00024 // 00025 // 00026 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ## 00027 // 00028 00029 include ('lib/ezdbschema/classes/ezdbschema.php'); 00030 include ('lib/ezdbschema/classes/ezmysqlschema.php'); 00031 include ('lib/ezdbschema/classes/ezpgsqlschema.php'); 00032 include ('lib/ezdbschema/classes/ezdbschemachecker.php'); 00033 00034 $dbschema1 = new eZDbSchema(); 00035 $schema1 = $dbschema1->readArray( '/tmp/schema1.php' ); 00036 00037 $dbschema2 = new eZDbSchema(); 00038 $schema2 = $dbschema2->readArray( '/tmp/schema2.php' ); 00039 00040 $differences = eZDbSchemaChecker::diff( $schema1, $schema2 ); /* empty 2nd param force new script */ 00041 00042 $foo = new eZMysqlSchema( nULL ); 00043 $foo->writeUpgradeFile( $differences, '/tmp/schema-diff.mysql' ); 00044 00045 $foo = new eZPgsqlSchema( nULL ); 00046 $foo->writeUpgradeFile( $differences, '/tmp/schema-diff.pgsql' ); 00047 00048 ?>
1.6.3