]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 625741: Need a hook in update_fielddefs_definition to enable adding columns to...
authorrojanu <aliustek@gmail.com>
Sun, 23 Jan 2011 12:06:51 +0000 (13:06 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 23 Jan 2011 12:06:51 +0000 (13:06 +0100)
r/a=mkanat

Bugzilla/Hook.pm
Bugzilla/Install/DB.pm
extensions/Example/Extension.pm

index 1b4bdd9719932f29d1d4943b30c1b09a7a0d1b70..abedfde4a8e5e2ac7c342113a341f6b0574796eb 100644 (file)
@@ -718,6 +718,15 @@ during an installation or upgrade. If you need to modify your custom
 schema or add new columns to existing tables, do it here. No params are
 passed.
 
+=head2 install_update_db_fielddefs
+
+This is used to update the schema of the fielddefs table before
+any other schema changes take place. No params are passed.
+
+This hook should only be used for updating the schema of the C<fielddefs>
+table. Do not modify any other table in this hook. To modify other tables, use
+the L</install_update_db> hook.
+
 =head2 db_schema_abstract_schema
 
 This allows you to add tables to Bugzilla. Note that we recommend that you 
index 9cbd66f425ac861fdabcfd2fca47eac96fdd88e0..fee87fa92a7afa2d40b40c2c9b01067c7ffe1b1a 100644 (file)
@@ -119,6 +119,8 @@ sub update_fielddefs_definition {
         {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
     $dbh->do('UPDATE fielddefs SET is_numeric = 1 WHERE type = '
              . FIELD_TYPE_BUG_ID);
+             
+    Bugzilla::Hook::process('install_update_db_fielddefs');
 
     # Remember, this is not the function for adding general table changes.
     # That is below. Add new changes to the fielddefs table above this
index 78f7c6d242ed10652cf952a19ccf3478ad3f42ef..14bf6df8732394b3b150de3e751c739ee81b4e88 100644 (file)
@@ -402,6 +402,12 @@ sub install_before_final_checks {
     # hook/global/setting-descs-settings.none.tmpl .
 }
 
+#sub install_update_db_fielddefs {
+#    my $dbh = Bugzilla->dbh;
+#    $dbh->bz_add_column('fielddefs', 'example_column', 
+#                        {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => ''});
+#}
+
 sub job_map {
     my ($self, $args) = @_;