mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12786] Add clean_cpf_db_entries
Add function to clean the cpf fields entries PHPBB3-12786
This commit is contained in:
parent
52204e0e6d
commit
18631801d5
1 changed files with 23 additions and 0 deletions
|
@ -141,6 +141,29 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
|
||||||
$insert_buffer->flush();
|
$insert_buffer->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean db after purging of extension
|
||||||
|
* function should be called from migration
|
||||||
|
* using revert_data()
|
||||||
|
*/
|
||||||
|
public function clean_cpf_db_entries()
|
||||||
|
{
|
||||||
|
$field_id = $this->get_custom_profile_field_id();
|
||||||
|
|
||||||
|
//Let's clean the field
|
||||||
|
//1. PROFILE_FIELDS_TABLE
|
||||||
|
$sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . ' WHERE field_id = ' . $field_id;
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
//2. PPROFILE_LANG_TABLE
|
||||||
|
$sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE field_id = ' . $field_id;
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
//3. PROFILE_FIELDS_LANG_TABLE
|
||||||
|
$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE field_id = ' . $field_id;
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get custom profile field id
|
* Get custom profile field id
|
||||||
* @return int custom profile filed id
|
* @return int custom profile filed id
|
||||||
|
|
Loading…
Add table
Reference in a new issue