Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../includes/Database/Migratio...
File: Relationships.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
class NF_Database_Migrations_Relationships extends NF_Abstracts_Migration
[2] Fix | Delete
{
[3] Fix | Delete
/**
[4] Fix | Delete
* Constructor method for the NF_Database_Migrations_Relationships 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_relationships',
[12] Fix | Delete
'nf_migration_create_table_relationships'
[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
public function run()
[22] Fix | Delete
{
[23] Fix | Delete
$query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
[24] Fix | Delete
`id` int NOT NULL AUTO_INCREMENT,
[25] Fix | Delete
`child_id` int NOT NULL,
[26] Fix | Delete
`child_type` longtext NOT NULL,
[27] Fix | Delete
`parent_id` int NOT NULL,
[28] Fix | Delete
`parent_type` longtext NOT NULL,
[29] Fix | Delete
`created_at` TIMESTAMP,
[30] Fix | Delete
`updated_at` DATETIME,
[31] Fix | Delete
UNIQUE KEY (`id`)
[32] Fix | Delete
) {$this->charset_collate( true )};";
[33] Fix | Delete
[34] Fix | Delete
dbDelta( $query );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Function to ensure proper collation of the relationships table.
[39] Fix | Delete
*
[40] Fix | Delete
* @since 3.4.0
[41] Fix | Delete
*/
[42] Fix | Delete
public function cache_collate_objects()
[43] Fix | Delete
{
[44] Fix | Delete
global $wpdb;
[45] Fix | Delete
// Modify our table.
[46] Fix | Delete
$query = "ALTER TABLE {$this->table_name()}
[47] Fix | Delete
MODIFY `child_type` longtext {$this->charset_collate()} NOT NULL,
[48] Fix | Delete
MODIFY `parent_type` longtext {$this->charset_collate()} NOT NULL;";
[49] Fix | Delete
$wpdb->query( $query );
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function