PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / config / migrations / 20201216124002_ExpandIndexableIDColumnLengths.php

20201216124002_ExpandIndexableIDColumnLengths.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.5, at src/config/migrations/20201216124002_ExpandIndexableIDColumnLengths.php

64 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Config\Migrations;
4
5 use Yoast\WP\Lib\Migrations\Migration;
6 use Yoast\WP\Lib\Model;
7
8 /**
9 * ExpandIndexableIDColumnLengths class.
10 */
11 class ExpandIndexableIDColumnLengths extends Migration {
12
13 /**
14 * The plugin this migration belongs to.
15 *
16 * @var string
17 */
18 public static $plugin = 'free';
19
20 /**
21 * The columns to change the column type and length of.
22 *
23 * @var string[]
24 */
25 protected static $columns_to_change = [
26 'object_id',
27 'author_id',
28 'post_parent',
29 ];
30
31 /**
32 * Migration up.
33 *
34 * @return void
35 */
36 public function up() {
37 foreach ( self::$columns_to_change as $column ) {
38 $this->change_column(
39 $this->get_table_name(),
40 $column,
41 'biginteger',
42 [ 'limit' => 20 ],
43 );
44 }
45 }
46
47 /**
48 * Migration down.
49 *
50 * @return void
51 */
52 public function down() {
53 }
54
55 /**
56 * Retrieves the table name to use for storing indexables.
57 *
58 * @return string The table name to use.
59 */
60 protected function get_table_name() {
61 return Model::get_table_name( 'Indexable' );
62 }
63 }
64