PDF rausgenommen
This commit is contained in:
@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/**
|
||||
* Class WpYoastIndexable
|
||||
*
|
||||
* @package WPSEO\Migrations
|
||||
*/
|
||||
|
||||
use YoastSEO_Vendor\Ruckusing_Migration_Base;
|
||||
use Yoast\WP\Free\Yoast_Model;
|
||||
|
||||
/**
|
||||
* Indexable migration.
|
||||
*/
|
||||
class WpYoastIndexable extends Ruckusing_Migration_Base {
|
||||
|
||||
/**
|
||||
* Migration up.
|
||||
*/
|
||||
public function up() {
|
||||
$table_name = $this->get_table_name();
|
||||
|
||||
$indexable_table = $this->create_table( $table_name );
|
||||
|
||||
$indexable_table->column( 'permalink', 'string', array( 'null' => true, 'limit' => 191 ) );
|
||||
|
||||
$indexable_table->column( 'object_id', 'integer', array( 'unsigned' => true, 'null' => true, 'limit' => 11 ) );
|
||||
$indexable_table->column( 'object_type', 'string', array( 'limit' => 16 ) );
|
||||
$indexable_table->column( 'object_sub_type', 'string', array( 'null' => true, 'limit' => 100 ) );
|
||||
|
||||
$indexable_table->column(
|
||||
'number_of_pages',
|
||||
'integer',
|
||||
array(
|
||||
'unsigned' => true,
|
||||
'null' => true,
|
||||
'default' => null,
|
||||
'limit' => 11,
|
||||
)
|
||||
);
|
||||
|
||||
$indexable_table->column( 'canonical', 'string', array( 'null' => true, 'limit' => 191 ) );
|
||||
|
||||
$indexable_table->column( 'title', 'string', array( 'null' => true, 'limit' => 191 ) );
|
||||
$indexable_table->column( 'description', 'text', array( 'null' => true ) );
|
||||
$indexable_table->column( 'breadcrumb_title', 'string', array( 'null' => true, 'limit' => 191 ) );
|
||||
|
||||
$indexable_table->column( 'is_robots_noindex', 'boolean', array( 'null' => true, 'default' => false ) );
|
||||
$indexable_table->column( 'is_robots_nofollow', 'boolean', array( 'null' => true, 'default' => false ) );
|
||||
$indexable_table->column( 'is_robots_noarchive', 'boolean', array( 'null' => true, 'default' => false ) );
|
||||
$indexable_table->column( 'is_robots_noimageindex', 'boolean', array( 'null' => true, 'default' => false ) );
|
||||
$indexable_table->column( 'is_robots_nosnippet', 'boolean', array( 'null' => true, 'default' => false ) );
|
||||
|
||||
$indexable_table->column( 'primary_focus_keyword', 'string', array( 'null' => true, 'limit' => 191 ) );
|
||||
$indexable_table->column( 'primary_focus_keyword_score', 'integer', array( 'null' => true, 'limit' => 3 ) );
|
||||
|
||||
$indexable_table->column( 'readability_score', 'integer', array( 'null' => true, 'limit' => 3 ) );
|
||||
|
||||
$indexable_table->column( 'is_cornerstone', 'boolean', array( 'default' => false ) );
|
||||
|
||||
$indexable_table->column( 'link_count', 'integer', array( 'null' => true, 'limit' => 11 ) );
|
||||
$indexable_table->column( 'incoming_link_count', 'integer', array( 'null' => true, 'limit' => 11 ) );
|
||||
|
||||
// Exexcute the SQL to create the table.
|
||||
$indexable_table->finish();
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'permalink',
|
||||
),
|
||||
array(
|
||||
'name' => 'unique_permalink',
|
||||
'unique' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'object_type',
|
||||
'object_sub_type',
|
||||
),
|
||||
array(
|
||||
'name' => 'indexable',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'primary_focus_keyword_score',
|
||||
'object_type',
|
||||
'object_sub_type',
|
||||
),
|
||||
array(
|
||||
'name' => 'primary_focus_keyword_score',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'is_cornerstone',
|
||||
'object_type',
|
||||
'object_sub_type',
|
||||
),
|
||||
array(
|
||||
'name' => 'cornerstones',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'incoming_link_count',
|
||||
'object_type',
|
||||
'object_sub_type',
|
||||
),
|
||||
array(
|
||||
'name' => 'orphaned_content',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'is_robots_noindex',
|
||||
'object_id',
|
||||
'object_type',
|
||||
'object_sub_type',
|
||||
),
|
||||
array(
|
||||
'name' => 'robots_noindex',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_timestamps( $table_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration down.
|
||||
*/
|
||||
public function down() {
|
||||
$this->drop_table( $this->get_table_name() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the table name to use.
|
||||
*
|
||||
* @return string The table name to use.
|
||||
*/
|
||||
protected function get_table_name() {
|
||||
return Yoast_Model::get_table_name( 'Indexable' );
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* Primary Term table migration.
|
||||
*
|
||||
* @package WPSEO\Migrations
|
||||
*/
|
||||
|
||||
use YoastSEO_Vendor\Ruckusing_Migration_Base;
|
||||
use Yoast\WP\Free\Yoast_Model;
|
||||
|
||||
/**
|
||||
* Migration for the Primary Term.
|
||||
*/
|
||||
class WpYoastPrimaryTerm extends Ruckusing_Migration_Base {
|
||||
|
||||
/**
|
||||
* Migration up.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
$table_name = $this->get_table_name();
|
||||
|
||||
$indexable_table = $this->create_table( $table_name );
|
||||
|
||||
$indexable_table->column(
|
||||
'post_id',
|
||||
'integer',
|
||||
array(
|
||||
'unsigned' => true,
|
||||
'null' => false,
|
||||
'limit' => 11,
|
||||
)
|
||||
);
|
||||
$indexable_table->column(
|
||||
'term_id',
|
||||
'integer',
|
||||
array(
|
||||
'unsigned' => true,
|
||||
'null' => false,
|
||||
'limit' => 11,
|
||||
)
|
||||
);
|
||||
$indexable_table->column(
|
||||
'taxonomy',
|
||||
'string',
|
||||
array(
|
||||
'null' => false,
|
||||
'limit' => 191,
|
||||
)
|
||||
);
|
||||
|
||||
// Executes the SQL to create the table.
|
||||
$indexable_table->finish();
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'post_id',
|
||||
'taxonomy',
|
||||
),
|
||||
array(
|
||||
'name' => 'post_taxonomy',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'post_id',
|
||||
'term_id',
|
||||
),
|
||||
array(
|
||||
'name' => 'post_term',
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_timestamps( $table_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration down.
|
||||
*/
|
||||
public function down() {
|
||||
$this->drop_table( $this->get_table_name() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the table name to use.
|
||||
*
|
||||
* @return string Table name to use.
|
||||
*/
|
||||
protected function get_table_name() {
|
||||
return Yoast_Model::get_table_name( 'Primary_Term' );
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Class WpYoastIndexableMeta
|
||||
*
|
||||
* @package WPSEO\Migrations
|
||||
*/
|
||||
|
||||
use YoastSEO_Vendor\Ruckusing_Migration_Base;
|
||||
use Yoast\WP\Free\Yoast_Model;
|
||||
|
||||
/**
|
||||
* Indexable meta migration.
|
||||
*/
|
||||
class WpYoastIndexableMeta extends Ruckusing_Migration_Base {
|
||||
|
||||
/**
|
||||
* Migration up.
|
||||
*/
|
||||
public function up() {
|
||||
$table_name = $this->get_table_name();
|
||||
|
||||
$indexable_meta_table = $this->create_table( $table_name );
|
||||
$indexable_meta_table->column(
|
||||
'indexable_id',
|
||||
'integer',
|
||||
array(
|
||||
'unsigned' => true,
|
||||
'limit' => 11,
|
||||
)
|
||||
);
|
||||
$indexable_meta_table->column( 'meta_key', 'string', array( 'limit' => 191 ) );
|
||||
$indexable_meta_table->column(
|
||||
'meta_value',
|
||||
'text',
|
||||
array(
|
||||
'null' => true,
|
||||
'limit' => 191,
|
||||
)
|
||||
);
|
||||
|
||||
// Execute the SQL to create the table.
|
||||
$indexable_meta_table->finish();
|
||||
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
array(
|
||||
'indexable_id',
|
||||
'meta_key',
|
||||
),
|
||||
array(
|
||||
'name' => 'indexable_meta',
|
||||
'unique' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_timestamps( $table_name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration down.
|
||||
*/
|
||||
public function down() {
|
||||
$this->drop_table( $this->get_table_name() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the table name to use.
|
||||
*
|
||||
* @return string The table name to use.
|
||||
*/
|
||||
protected function get_table_name() {
|
||||
return Yoast_Model::get_table_name( 'Indexable_Meta' );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user