mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/12786] Add clean_cpf_db_entries
Add function to clean the cpf fields entries PHPBB3-12786
This commit is contained in:
@@ -141,6 +141,29 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
|
||||
$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
|
||||
* @return int custom profile filed id
|
||||
|
Reference in New Issue
Block a user