123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- use think\facade\Db;
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateFishAdTable 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 `fl_fish_campaign` (
- `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',
- `campaign_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '广告组id',
- `campaign_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '广告组name',
- `stat_datetime` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据起始时间',
- `inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '投放广告位',
- `cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '展现数据-总花费',
- `show` int(11) NULL DEFAULT 0 COMMENT '展现数据-展示数',
- `avg_show_cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '展现数据-平均千次展现费用',
- `click` int(11) NULL DEFAULT 0 COMMENT '展现数据-点击数',
- `avg_click_cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '展现数据-平均点击单价',
- `ctr` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '展现数据-点击率',
- `convert` int(11) NULL DEFAULT 0 COMMENT '转化数据-转化数',
- `convert_cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '转化数据-转化成本',
- `convert_rate` int(11) NULL DEFAULT 0 COMMENT '转化数据-转化率',
- `deep_convert` int(11) NULL DEFAULT 0 COMMENT '转化数据-深度转化数',
- `deep_convert_cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '转化数据-深度转化成本',
- `deep_convert_rate` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '转化数据-深度转化率',
- `root_id` int(11) NULL DEFAULT 0 COMMENT '关联组织',
- `data_time` date NULL DEFAULT NULL COMMENT '数据日期-每日请求一次插入数据',
- `type` tinyint(1) NULL DEFAULT 1 COMMENT '1飞鱼2腾讯3欧派',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `root_id`(`root_id`) USING BTREE,
- INDEX `advertiser_id`(`advertiser_id`) USING BTREE,
- INDEX `data_time`(`data_time`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '飞鱼广告数据' ROW_FORMAT = DYNAMIC;");
- }
- }
|