/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     DB::update('alter table asset_versions add extension varchar(10)');
     $versions = AssetVersion::all();
     foreach ($versions as $v) {
         preg_match('|\\.([a-z]+)$|', $v->filename, $matches);
         if (isset($matches[1])) {
             $v->extension = $matches[1];
             $v->save();
         }
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     DB::statement('alter table asset_versions add mimetype varchar(255)');
     $versions = AssetVersion::all();
     $directory = storage_path('boomcms/assets');
     foreach ($versions as $v) {
         $path = realpath($directory . DIRECTORY_SEPARATOR . $v->id);
         if ($path) {
             $finfo = finfo_open(FILEINFO_MIME_TYPE);
             $mime = finfo_file($finfo, $path);
             finfo_close($finfo);
             if ($mime) {
                 $v->mimetype = $mime;
                 $v->save();
             }
         }
     }
 }