20230528042924_fish_live.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. use think\facade\Db;
  5. class FishLive extends Migrator
  6. {
  7. /**
  8. * Change Method.
  9. *
  10. * Write your reversible migrations using this method.
  11. *
  12. * More information on writing migrations is available here:
  13. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  14. *
  15. * The following commands can be used in this method and Phinx will
  16. * automatically reverse them when rolling back:
  17. *
  18. * createTable
  19. * renameTable
  20. * addColumn
  21. * renameColumn
  22. * addIndex
  23. * addForeignKey
  24. *
  25. * Remember to call "create()" or "update()" and NOT "save()" when working
  26. * with the Table class.
  27. */
  28. public function change()
  29. {
  30. Db::execute("CREATE TABLE IF NOT EXISTS `fl_fish_live` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  32. `advertiser_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '广告主ID',
  33. `data_time` date NULL DEFAULT NULL COMMENT '数据日期-每日请求一次插入数据',
  34. `root_id` int(11) NULL DEFAULT NULL COMMENT '关联组织',
  35. `type` tinyint(1) NULL DEFAULT 1 COMMENT '1飞鱼2腾讯3欧派',
  36. `room_id` bigint(18) NOT NULL DEFAULT 0 COMMENT '直播间ID',
  37. `room_title` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '直播间标题',
  38. `live_watch_count` int(11) NULL DEFAULT NULL COMMENT '观看数',
  39. `live_watch_ucount` int(11) NULL DEFAULT NULL COMMENT '观看人数',
  40. `click_product_ucount` int(11) NULL DEFAULT NULL COMMENT '商品点击人数',
  41. `live_form_submit_count` int(11) NULL DEFAULT NULL COMMENT '留资线索数',
  42. `live_card_icon_component_show_count` int(11) NULL DEFAULT NULL COMMENT '组件点击数,即观众在直播间内点击小风车组件+卡片组件的总次数',
  43. `room_status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '直播间状态',
  44. `room_create_time` timestamp(0) NULL DEFAULT NULL COMMENT '直播开始时间',
  45. `room_finish_time` timestamp(0) NULL DEFAULT NULL COMMENT '直播结束时间',
  46. `anchor_id` bigint(18) NULL DEFAULT NULL COMMENT '主播id',
  47. `anchor_nick` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主播昵称',
  48. `data_create` date NULL DEFAULT NULL COMMENT '数据日期-每日请求一次插入数据',
  49. PRIMARY KEY (`id`) USING BTREE,
  50. UNIQUE INDEX `roomID`(`room_id`) USING BTREE COMMENT '直播间号'
  51. ) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '巨量直播数据表' ROW_FORMAT = Dynamic;");
  52. }
  53. }