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(); } }