View Revisions: Issue #24509

Summary 0024509: public function upgrade( $p_schema )
Revision 2018-05-31 05:36 by dregad
Description

The following is written in the MantisPlugin.class.php file:

/ **
* This callback is executed after the normal schema upgrade process has executed.
* This gives your plugin the chance to convert or normalize data after an upgrade
*
* @todo It is possible to call php functions from within the schema upgrade itself, so really needed?
*
* @param integer $ p_schema Schema Version ID.
* @return boolean
* /
public function upgrade ($ p_schema) {
return true;
}

And in plugin_api.pxp this function is executed before the schema update:

$ i = $ t_schema_version + 1;
while ($ i <count ($ t_schema)) {
if (! $ p_plugin-> upgrade ($ i)) {
plugin_pop_current ();
return false;
}
$ t_target = $ t_schema [$ i] [1] [0];
switch ($ t_schema [$ i] [0]) {
case 'InsertData':

Why?
I apologize in advance, maybe I did not fully understand.

I change the database schema in the plugin. I need to convert the data after changing the schema.

Revision 2018-05-31 05:35 by dregad
Description

The following is written in the MantisPlugin.class.php file:

/ **
* This callback is executed after the normal schema upgrade process has executed.
* This gives your plugin the chance to convert or normalize data after an upgrade
*
* @todo It is possible to call php functions from within the schema upgrade itself, so really needed?
*
* @param integer $ p_schema Schema Version ID.
* @return boolean
* /
public function upgrade ($ p_schema) {
return true;
}
------------------------------------------------------------------------------------------------------------

And in plugin_api.pxp this function is executed before the schema update:

$ i = $ t_schema_version + 1;
while ($ i <count ($ t_schema)) {
if (! $ p_plugin-> upgrade ($ i)) {
plugin_pop_current ();
return false;
}
$ t_target = $ t_schema [$ i] [1] [0];
switch ($ t_schema [$ i] [0]) {
case 'InsertData':

Why?
I apologize in advance, maybe I did not fully understand.

I change the database schema in the plugin. I need to convert the data after changing the schema.

Revision 2018-05-31 05:03 by 123
Description

The following is written in the MantisPlugin.class.php file:

/ **

  • This callback is executed after the normal schema upgrade process has executed.
  • This gives your plugin the chance to convert or normalize data after an upgrade
  • @todo It is possible to call php functions from within the schema upgrade itself, so really needed?
  • @param integer $ p_schema Schema Version ID.
  • @return boolean
  • /
    public function upgrade ($ p_schema) {
    return true;
    }

And in plugin_api.pxp this function is executed before the schema update:

$ i = $ t_schema_version + 1;
while ($ i <count ($ t_schema)) {
if (! $ p_plugin-> upgrade ($ i)) {
plugin_pop_current ();
return false;
}
$ t_target = $ t_schema [$ i] [1] [0];
switch ($ t_schema [$ i] [0]) {
case 'InsertData':

Why?
I apologize in advance, maybe I did not fully understand.

I change the database schema in the plugin. I need to convert the data after changing the schema.