PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.4.2
Independent Analytics – WordPress Analytics Plugin v2.4.2
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Migrations / Migration_16.php
Migration_16.php
29 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\Migrations;
4
5 use IAWP\Query;
6 /** @internal */
7 class Migration_16 extends \IAWP\Migrations\Migration
8 {
9 /**
10 * @var string
11 */
12 protected $database_version = '16';
13 /**
14 * @return void
15 */
16 protected function migrate() : void
17 {
18 $this->create_reports_table();
19 }
20 private function create_reports_table() : void
21 {
22 global $wpdb;
23 $charset_collate = $wpdb->get_charset_collate();
24 $reports_table = Query::get_table_name(Query::REPORTS);
25 $wpdb->query("DROP TABLE IF EXISTS {$reports_table}");
26 $wpdb->query("CREATE TABLE {$reports_table} (\n report_id bigint(20) UNSIGNED AUTO_INCREMENT,\n user_created_report boolean NOT NULL DEFAULT true,\n name varchar(255) NOT NULL,\n type varchar(64) NOT NULL,\n exact_start datetime,\n exact_end datetime,\n relative_range_id varchar(64),\n sort_column varchar(64),\n sort_direction varchar(64),\n group_name varchar(64),\n chart_interval varchar(64),\n columns text,\n filters text,\n visible_datasets text,\n position int,\n PRIMARY KEY (report_id)\n ) {$charset_collate}");
27 }
28 }
29