Files
ulthon_information/database/migrations/20260501000000_create_table_post_output.php
augushong 83a2bd48a2 feat(post): 新增手机图片排版与AI智能排版功能
- 新增手机图片排版功能,支持小红书/抖音尺寸输出
- 新增AI智能排版顾问,支持内容分析与优化推荐
- 新增AI供应商管理,支持多渠道配置与同步
- 新增文章输出管理页面,支持图片预览与批量下载
- 新增字体文件与排版样式配置
2026-05-01 12:23:17 +08:00

38 lines
2.0 KiB
PHP

<?php
use app\common\ColumnFormat;
use think\migration\Migrator;
use think\migration\db\Column;
class CreateTablePostOutput extends Migrator
{
public function change()
{
$table = $this->table('post_output', ['comment' => '文章输出任务']);
$table->addColumn(ColumnFormat::integer('post_id')->setComment('文章ID'));
$table->addColumn(ColumnFormat::stringShort('output_type')->setComment('输出类型'));
$table->addColumn(Column::make('config', 'text')->setComment('配置'));
$table->addColumn(ColumnFormat::integerTypeStatus('status')->setComment('状态,0:待处理,1:处理中,2:完成,3:失败'));
$table->addColumn(ColumnFormat::integer('page_count')->setComment('页数'));
$table->addColumn(ColumnFormat::integer('admin_id')->setComment('管理员ID'));
$table->addColumn(ColumnFormat::timestamp('create_time'));
$table->addColumn(ColumnFormat::timestamp('update_time'));
$table->addColumn(ColumnFormat::timestamp('delete_time'));
$table->addIndex('post_id');
$table->addIndex('status');
$table->create();
$tableFile = $this->table('post_output_file', ['comment' => '文章输出文件']);
$tableFile->addColumn(ColumnFormat::integer('output_id')->setComment('输出任务ID'));
$tableFile->addColumn(ColumnFormat::integer('page')->setComment('页码'));
$tableFile->addColumn(ColumnFormat::stringLong('file_path')->setComment('文件路径'));
$tableFile->addColumn(ColumnFormat::stringLong('file_url')->setComment('文件URL'));
$tableFile->addColumn(ColumnFormat::integer('file_size')->setComment('文件大小'));
$tableFile->addColumn(ColumnFormat::integer('width')->setComment('宽度'));
$tableFile->addColumn(ColumnFormat::integer('height')->setComment('高度'));
$tableFile->addColumn(ColumnFormat::timestamp('create_time'));
$tableFile->addIndex('output_id');
$tableFile->create();
}
}