table('filesystem_user_file', [ 'comment' => '文件表', 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'id' => false, 'primary_key' => 'id' ]); $table ->addColumn('id', 'integer', [ 'identity' => true, 'signed' => false, 'comment' => '主键' ]) ->addColumn('user_id', 'integer', [ 'default' => 0, 'signed' => false, 'comment' => '用户id' ]) ->addColumn('file_hash', 'string', [ 'default' => '', 'comment' => '文件hash' ])->addColumn('name', 'string', [ 'default' => '', 'comment' => '文件备注名称' ])->addColumn('file_name', 'string', [ 'default' => '', 'comment' => '文件名' ])->addColumn('file_path', 'string', [ 'default' => '', 'comment' => '文件路径' ])->addColumn('file_size', 'integer', [ 'default' => 0, 'comment' => '文件大小' ])->addColumn('file_ext', 'string', [ 'default' => '', 'comment' => '文件类型' ])->addColumn('file_mine', 'string', [ 'default' => '', 'comment' => '文件MIME' ])->addColumn('file_url', 'string', [ 'default' => '', 'comment' => '文件URL' ])->addTimestamps('create_time', 'update_time') ->addColumn('delete_time', 'timestamp', [ 'null' => true, 'comment' => '删除时间' ])->addIndex('file_hash', [ 'name' => 'file_hash' ])->create(); } }