1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- use think\facade\Db;
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateFishAdListTable 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_list` (
- `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',
- `ad_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '计划id',
- `ad_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 '数据起始时间',
- `cost` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '展现数据-总花费',
- `show` int(11) NULL DEFAULT 0 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 '转化数据-转化率',
- `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 `ad_id`(`ad_id`) USING BTREE,
- INDEX `data_time`(`data_time`) USING BTREE,
- INDEX `campaign_id`(`campaign_id`) USING BTREE
- ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '广告组下的广告计划' ROW_FORMAT = Dynamic;");
- }
- }
|