Edit File by line
/home/barbar84/www/wp-conte.../plugins/wordpres.../src/config/migratio...
File: 20171228151841_WpYoastPrimaryTerm.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Config\Migrations;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\Lib\Migrations\Migration;
[4] Fix | Delete
use Yoast\WP\Lib\Model;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Migration for the Primary Term.
[8] Fix | Delete
*/
[9] Fix | Delete
class WpYoastPrimaryTerm extends Migration {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* The plugin this migration belongs to.
[13] Fix | Delete
*
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
public static $plugin = 'free';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Migration up.
[20] Fix | Delete
*
[21] Fix | Delete
* @return void
[22] Fix | Delete
*/
[23] Fix | Delete
public function up() {
[24] Fix | Delete
$table_name = $this->get_table_name();
[25] Fix | Delete
[26] Fix | Delete
$indexable_table = $this->create_table( $table_name );
[27] Fix | Delete
[28] Fix | Delete
$indexable_table->column(
[29] Fix | Delete
'post_id',
[30] Fix | Delete
'integer',
[31] Fix | Delete
[
[32] Fix | Delete
'unsigned' => true,
[33] Fix | Delete
'null' => false,
[34] Fix | Delete
'limit' => 11,
[35] Fix | Delete
]
[36] Fix | Delete
);
[37] Fix | Delete
$indexable_table->column(
[38] Fix | Delete
'term_id',
[39] Fix | Delete
'integer',
[40] Fix | Delete
[
[41] Fix | Delete
'unsigned' => true,
[42] Fix | Delete
'null' => false,
[43] Fix | Delete
'limit' => 11,
[44] Fix | Delete
]
[45] Fix | Delete
);
[46] Fix | Delete
$indexable_table->column(
[47] Fix | Delete
'taxonomy',
[48] Fix | Delete
'string',
[49] Fix | Delete
[
[50] Fix | Delete
'null' => false,
[51] Fix | Delete
'limit' => 32,
[52] Fix | Delete
]
[53] Fix | Delete
);
[54] Fix | Delete
[55] Fix | Delete
// Executes the SQL to create the table.
[56] Fix | Delete
$indexable_table->finish();
[57] Fix | Delete
[58] Fix | Delete
$this->add_index(
[59] Fix | Delete
$table_name,
[60] Fix | Delete
[
[61] Fix | Delete
'post_id',
[62] Fix | Delete
'taxonomy',
[63] Fix | Delete
],
[64] Fix | Delete
[
[65] Fix | Delete
'name' => 'post_taxonomy',
[66] Fix | Delete
]
[67] Fix | Delete
);
[68] Fix | Delete
[69] Fix | Delete
$this->add_index(
[70] Fix | Delete
$table_name,
[71] Fix | Delete
[
[72] Fix | Delete
'post_id',
[73] Fix | Delete
'term_id',
[74] Fix | Delete
],
[75] Fix | Delete
[
[76] Fix | Delete
'name' => 'post_term',
[77] Fix | Delete
]
[78] Fix | Delete
);
[79] Fix | Delete
[80] Fix | Delete
$this->add_timestamps( $table_name );
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Migration down.
[85] Fix | Delete
*/
[86] Fix | Delete
public function down() {
[87] Fix | Delete
$this->drop_table( $this->get_table_name() );
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
/**
[91] Fix | Delete
* Retrieves the table name to use.
[92] Fix | Delete
*
[93] Fix | Delete
* @return string Table name to use.
[94] Fix | Delete
*/
[95] Fix | Delete
protected function get_table_name() {
[96] Fix | Delete
return Model::get_table_name( 'Primary_Term' );
[97] Fix | Delete
}
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function