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