table('yz_article_view', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_unicode_ci']); $table ->addColumn('article_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '文章ID']) ->addColumn('ip', 'string', ['limit' => 50, 'null' => false, 'comment' => '访问IP']) ->addColumn('view_time', 'integer', ['signed' => false, 'null' => false, 'comment' => '访问时间']) ->addIndex(['article_id', 'ip', 'view_time'], ['name' => 'idx_article_ip_time']) ->create(); } }