From 8cf22f552935417911306cb2830d7522791c9098 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 03:41:02 +0200 Subject: [PATCH 1/2] [ticket/10189] Add "automatically generated" comment into schema-files PHPBB3-10189 --- phpBB/develop/create_schema_files.php | 26 +++++++++++++++++++++++ phpBB/install/schemas/firebird_schema.sql | 5 +++++ phpBB/install/schemas/mssql_schema.sql | 8 +++++++ phpBB/install/schemas/mysql_40_schema.sql | 5 +++++ phpBB/install/schemas/mysql_41_schema.sql | 5 +++++ phpBB/install/schemas/oracle_schema.sql | 8 +++++++ phpBB/install/schemas/postgres_schema.sql | 8 +++++++ phpBB/install/schemas/sqlite_schema.sql | 5 +++++ 8 files changed, 70 insertions(+) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index efe8837b26..05acf7177d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -246,6 +246,32 @@ foreach ($supported_dbms as $dbms) $line = ''; + switch ($dbms) + { + case 'mysql_40': + case 'mysql_41': + case 'firebird': + case 'sqlite': + fwrite($fp, "# DO NOT EDIT THIS FILE, IT IS GENERATED\n"); + fwrite($fp, "#\n"); + fwrite($fp, "# To change the contents of this file, edit\n"); + fwrite($fp, "# phpBB/develop/create_schema_files.php and\n"); + fwrite($fp, "# run it.\n"); + break; + + case 'mssql': + case 'oracle': + case 'postgres': + fwrite($fp, "/*\n"); + fwrite($fp, " * DO NOT EDIT THIS FILE, IT IS GENERATED\n"); + fwrite($fp, " *\n"); + fwrite($fp, " * To change the contents of this file, edit\n"); + fwrite($fp, " * phpBB/develop/create_schema_files.php and\n"); + fwrite($fp, " * run it.\n"); + fwrite($fp, " */\n\n"); + break; + } + // Write Header switch ($dbms) { diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 40041b13cb..852c62705e 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1,3 +1,8 @@ +# DO NOT EDIT THIS FILE, IT IS GENERATED +# +# To change the contents of this file, edit +# phpBB/develop/create_schema_files.php and +# run it. # # $Id: $ # diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index c4fc2d4eec..bcdb0dc236 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1,3 +1,11 @@ +/* + * DO NOT EDIT THIS FILE, IT IS GENERATED + * + * To change the contents of this file, edit + * phpBB/develop/create_schema_files.php and + * run it. + */ + /* $Id: $ diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 06d32166f3..f0357afc23 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -1,3 +1,8 @@ +# DO NOT EDIT THIS FILE, IT IS GENERATED +# +# To change the contents of this file, edit +# phpBB/develop/create_schema_files.php and +# run it. # # $Id: $ # diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 1db2790ec7..97fe33dbdd 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -1,3 +1,8 @@ +# DO NOT EDIT THIS FILE, IT IS GENERATED +# +# To change the contents of this file, edit +# phpBB/develop/create_schema_files.php and +# run it. # # $Id: $ # diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 783261e365..d879da4048 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1,3 +1,11 @@ +/* + * DO NOT EDIT THIS FILE, IT IS GENERATED + * + * To change the contents of this file, edit + * phpBB/develop/create_schema_files.php and + * run it. + */ + /* $Id: $ diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index cf655cb1c7..f532492c2c 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1,3 +1,11 @@ +/* + * DO NOT EDIT THIS FILE, IT IS GENERATED + * + * To change the contents of this file, edit + * phpBB/develop/create_schema_files.php and + * run it. + */ + /* $Id: $ diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index dae1eb839c..5557e0a0b2 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -1,3 +1,8 @@ +# DO NOT EDIT THIS FILE, IT IS GENERATED +# +# To change the contents of this file, edit +# phpBB/develop/create_schema_files.php and +# run it. # # $Id: $ # From c3f3435228accc44e2fd8d358c21b81f8ec66d87 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 04:29:28 +0200 Subject: [PATCH 2/2] [ticket/10189] Get rid of $id$ from schema files PHPBB3-10189 --- phpBB/develop/create_schema_files.php | 17 +---------------- phpBB/install/schemas/firebird_schema.sql | 4 ---- phpBB/install/schemas/mssql_schema.sql | 6 ------ phpBB/install/schemas/mysql_40_schema.sql | 4 ---- phpBB/install/schemas/mysql_41_schema.sql | 4 ---- phpBB/install/schemas/oracle_schema.sql | 6 ------ phpBB/install/schemas/postgres_schema.sql | 6 ------ phpBB/install/schemas/sqlite_schema.sql | 4 ---- 8 files changed, 1 insertion(+), 50 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 05acf7177d..9ce5f72922 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -246,6 +246,7 @@ foreach ($supported_dbms as $dbms) $line = ''; + // Write Header switch ($dbms) { case 'mysql_40': @@ -272,37 +273,21 @@ foreach ($supported_dbms as $dbms) break; } - // Write Header switch ($dbms) { - case 'mysql_40': - case 'mysql_41': - $line = "#\n# \$I" . "d: $\n#\n\n"; - break; - case 'firebird': - $line = "#\n# \$I" . "d: $\n#\n\n"; $line .= custom_data('firebird') . "\n"; break; case 'sqlite': - $line = "#\n# \$I" . "d: $\n#\n\n"; $line .= "BEGIN TRANSACTION;\n\n"; break; - case 'mssql': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; - // no need to do this, no transaction support for schema changes - //$line .= "BEGIN TRANSACTION\nGO\n\n"; - break; - case 'oracle': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; $line .= custom_data('oracle') . "\n"; break; case 'postgres': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; $line .= "BEGIN;\n\n"; $line .= custom_data('postgres') . "\n"; break; diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 852c62705e..73052f0a22 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -3,10 +3,6 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# -# $Id: $ -# - # Table: 'phpbb_attachments' CREATE TABLE phpbb_attachments ( diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index bcdb0dc236..8ed3ba7e12 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -6,12 +6,6 @@ * run it. */ -/* - - $Id: $ - -*/ - /* Table: 'phpbb_attachments' */ diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index f0357afc23..42b7291d9d 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -3,10 +3,6 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# -# $Id: $ -# - # Table: 'phpbb_attachments' CREATE TABLE phpbb_attachments ( attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 97fe33dbdd..7a6d0ae188 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -3,10 +3,6 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# -# $Id: $ -# - # Table: 'phpbb_attachments' CREATE TABLE phpbb_attachments ( attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index d879da4048..6e7ec31efc 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -6,12 +6,6 @@ * run it. */ -/* - - $Id: $ - -*/ - /* This first section is optional, however its probably the best method of running phpBB on Oracle. If you already have a tablespace and user created diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index f532492c2c..38f167bc7b 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -6,12 +6,6 @@ * run it. */ -/* - - $Id: $ - -*/ - BEGIN; /* diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 5557e0a0b2..c0574244ca 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -3,10 +3,6 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# -# $Id: $ -# - BEGIN TRANSACTION; # Table: 'phpbb_attachments'