leoncx / testmigrate

0 stars 0 forks source link

A bug with db tables prefix when using export/import functions. #162

Open leoncx opened 10 years ago

leoncx commented 10 years ago

Author Name: Simon Bomm (Simon Bomm) Original Redmine Issue: 5093, https://forge.centreon.com/issues/5093 Original Date: 2014-01-08


Hi,

Find some kind of bug on my 2.5.0, to explain I just export a conf on a server A and import it to a server B.

Line 7008 : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'service_cg_additive_inheritance' in 'field list' Line 331 : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'host_cg_additive_inheritance' in 'field list'

Centreon-clapi 1.5.1 is trying to insert in db with tableprefix_target_field_name.

Should insert with target_field_name only.

I'll try to fix this one and I'll let you know.

Thanks !

leoncx commented 10 years ago

Original Redmine Comment Author Name: Jonathan YAMIN (Jonathan YAMIN) Original Date: 2014-04-14T09:44:28Z


Hello,

I'm currently working on an import script of centreon configuration. (with centreon-clapi 1.5.1)

I encountered the same error. I fix it and you can find the patch in attachment.

There are others fix like : import period null, if depend of the parent template (in service / host) and possibility to set an empty value (to set a null value in db).

Regards.