Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../includes/Database/Migratio...
File: FieldMeta.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
class NF_Database_Migrations_FieldMeta extends NF_Abstracts_Migration
[2] Fix | Delete
{
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Constructor method for the NF_Database_Migrations_FieldMeta class.
[6] Fix | Delete
*
[7] Fix | Delete
* @since 3.0.0
[8] Fix | Delete
*/
[9] Fix | Delete
public function __construct()
[10] Fix | Delete
{
[11] Fix | Delete
parent::__construct(
[12] Fix | Delete
'nf3_field_meta',
[13] Fix | Delete
'nf_migration_create_table_field_meta'
[14] Fix | Delete
);
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Function to run our initial migration.
[19] Fix | Delete
*
[20] Fix | Delete
* @since 3.0.0
[21] Fix | Delete
*
[22] Fix | Delete
* @updated 3.4.0
[23] Fix | Delete
*/
[24] Fix | Delete
public function run()
[25] Fix | Delete
{
[26] Fix | Delete
$query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
[27] Fix | Delete
`id` int NOT NULL AUTO_INCREMENT,
[28] Fix | Delete
`parent_id` int NOT NULL,
[29] Fix | Delete
`key` longtext NOT NULL,
[30] Fix | Delete
`value` longtext,
[31] Fix | Delete
`meta_key` longtext,
[32] Fix | Delete
`meta_value` longtext,
[33] Fix | Delete
UNIQUE KEY (`id`)
[34] Fix | Delete
) {$this->charset_collate( true )};";
[35] Fix | Delete
[36] Fix | Delete
dbDelta( $query );
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Function to run our stage three upgrades.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 3.3.12
[43] Fix | Delete
*
[44] Fix | Delete
* @updated 3.4.0
[45] Fix | Delete
*/
[46] Fix | Delete
public function cache_collate_fields()
[47] Fix | Delete
{
[48] Fix | Delete
// If the meta_key column has not already been defined...
[49] Fix | Delete
if ( ! $this->column_exists( 'meta_key' ) ) {
[50] Fix | Delete
global $wpdb;
[51] Fix | Delete
// Modify our table.
[52] Fix | Delete
$query = "ALTER TABLE {$this->table_name()}
[53] Fix | Delete
ADD `meta_key` longtext {$this->charset_collate()},
[54] Fix | Delete
ADD `meta_value` longtext {$this->charset_collate()}";
[55] Fix | Delete
$wpdb->query( $query );
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function