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