Migration.php
3 years ago
Migration_1_0.php
3 years ago
Migration_1_6.php
3 years ago
Migration_1_8.php
3 years ago
Migration_1_9.php
3 years ago
Migration_2.php
3 years ago
Migration_3.php
3 years ago
Migration_4.php
3 years ago
Migration_5.php
3 years ago
Migration_6.php
3 years ago
Migration_7.php
3 years ago
Migration_8.php
3 years ago
Migration_9.php
3 years ago
Migration_Job.php
3 years ago
Migration_1_6.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Migrations; |
| 4 | |
| 5 | use IAWP\Query; |
| 6 | |
| 7 | class Migration_1_6 extends Migration |
| 8 | { |
| 9 | /** |
| 10 | * @var string |
| 11 | */ |
| 12 | protected $database_version = '1.6'; |
| 13 | |
| 14 | /** |
| 15 | * @return void |
| 16 | */ |
| 17 | protected function handle(): void |
| 18 | { |
| 19 | global $wpdb; |
| 20 | |
| 21 | $charset_collate = $wpdb->get_charset_collate(); |
| 22 | |
| 23 | $views_table = Query::get_table_name(Query::VIEWS); |
| 24 | $wpdb->query("ALTER TABLE $views_table ADD visitor_id bigint(20) UNSIGNED"); |
| 25 | |
| 26 | $visitors_table = Query::get_table_name(Query::VISITORS); |
| 27 | $wpdb->query("DROP TABLE IF EXISTS $visitors_table"); |
| 28 | $wpdb->query("CREATE TABLE $visitors_table ( |
| 29 | id bigint(20) UNSIGNED AUTO_INCREMENT, |
| 30 | visitor_token varchar(256), |
| 31 | PRIMARY KEY (id) |
| 32 | ) $charset_collate"); |
| 33 | } |
| 34 | } |
| 35 |