Codeigniter: 'foreign_key_checks' => FALSE : constraints appear in backup file

Created on 24 Mar 2016  路  5Comments  路  Source: bcit-ci/CodeIgniter

Hello,
When i put 'foreign_key_checks' => FALSE in preferences for backup database, the foreign key constraints appear in the backup file.
If i set it toTRUE, it's the same thing. For TRUE setting it's "normal" but with FALSE not yet.

There is a possible error ?
I use CI 3.06, driver mysqli (Mysql version 5.6.15)

My code:
$this->load->dbutil();
$prefs = array( 'newline' => "\n",
'add_drop' => TRUE,
'add_insert' => TRUE,
'format' => 'zip',
'filename' => 'back.sql',
'foreign_key_checks' => FALSE,
);
$backup = $this->dbutil->backup($prefs);
$this->load->helper('file');
$nom_export = date('Y_m_d').'_fuge.sql.zip';
write_file(UPLOAD.$nom_export, $backup);

All 5 comments

The option doesn't remove the foreign keys, it only causes MySQL to ignore foreign key checks while importing the data, because that could otherwise make it impossible to import.

Thank you.

Don't thank me, just don't post here about every problem you encounter, like you have done twice before.

This is not the first time that you meet so unpleasant to people. I have found that your comrades have already made you such remarks when replying to different people asking for help or reporting a problem. Should learn to have restraint. This demonstrates the maturity.
Have a good day.

Sorry for asking you not to use our bug tracker as a free help request service, after you've done that 3 times.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boblennes picture boblennes  路  4Comments

monski picture monski  路  4Comments

huehnerhose picture huehnerhose  路  6Comments

vahidvdn picture vahidvdn  路  4Comments

Tjoosten picture Tjoosten  路  6Comments