| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/wordpress-seo/migrations/ |
Upload File : |
<?php
/**
* Yoast SEO Plugin File.
*
* @package WPSEO\Migrations
*/
use Yoast\WP\Free\ORM\Yoast_Model;
use YoastSEO_Vendor\Ruckusing_Migration_Base;
/**
* Class WpYoastExpandIndexable
*/
class WpYoastExpandIndexable extends Ruckusing_Migration_Base {
/**
* Migration up.
*/
public function up() {
$table_name = $this->get_table_name();
$this->add_column( $table_name, 'og_title', 'string', array( 'null' => true, 'limit' => 191 ) );
$this->add_column( $table_name, 'og_image', 'mediumtext', array( 'null' => true ) );
$this->add_column( $table_name, 'og_description', 'mediumtext', array( 'null' => true ) );
$this->add_column( $table_name, 'twitter_title', 'string', array( 'null' => true, 'limit' => 191 ) );
$this->add_column( $table_name, 'twitter_image', 'mediumtext', array( 'null' => true ) );
$this->add_column( $table_name, 'twitter_description', 'mediumtext', array( 'null' => true ) );
$this->add_column( $table_name, 'permalink_hash', 'string', array( 'null' => true, 'limit' => 191 ) );
$this->add_index( $table_name, 'permalink_hash' );
$this->remove_index(
$table_name,
array(
'permalink',
),
array(
'name' => 'unique_permalink',
'unique' => true,
)
);
$this->change_column( $table_name, 'permalink', 'mediumtext', array( 'null' => true ) );
$this->change_column( $table_name, 'canonical', 'mediumtext', array( 'null' => true ) );
}
/**
* Migration down.
*/
public function down() {
$table_name = $this->get_table_name();
$this->remove_column( $table_name, 'og_title' );
$this->remove_column( $table_name, 'og_image' );
$this->remove_column( $table_name, 'og_description' );
$this->remove_column( $table_name, 'twitter_title' );
$this->remove_column( $table_name, 'twitter_image' );
$this->remove_column( $table_name, 'twitter_description' );
$this->remove_index( $table_name, 'permalink_hash' );
$this->remove_column( $table_name, 'permalink_hash' );
$this->change_column( $table_name, 'permalink', 'string', array( 'null' => true, 'limit' => 191 ) );
$this->change_column( $table_name, 'canonical', 'string', array( 'null' => true, 'limit' => 191 ) );
$this->add_index(
$table_name,
array(
'permalink',
),
array(
'name' => 'unique_permalink',
'unique' => true,
)
);
}
/**
* 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' );
}
}