2018-08-27 01:32:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2018-08-28 03:07:36 +00:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2018-08-27 01:32:12 +00:00
|
|
|
|
|
|
|
class UpdateMediaTableAddAltText extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2018-08-28 03:07:36 +00:00
|
|
|
Schema::table('media', function (Blueprint $table) {
|
2018-08-27 01:32:12 +00:00
|
|
|
$table->string('original_sha256')->nullable()->index()->after('user_id');
|
|
|
|
$table->string('optimized_sha256')->nullable()->index()->after('original_sha256');
|
|
|
|
$table->string('caption')->nullable()->after('thumbnail_url');
|
|
|
|
$table->string('hls_path')->nullable()->after('caption');
|
|
|
|
$table->timestamp('hls_transcoded_at')->nullable()->after('processed_at');
|
|
|
|
$table->string('key')->nullable();
|
|
|
|
$table->json('metadata')->nullable();
|
2018-08-28 03:07:36 +00:00
|
|
|
});
|
2018-08-27 01:32:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2018-08-28 03:07:36 +00:00
|
|
|
Schema::table('media', function (Blueprint $table) {
|
2021-06-01 05:26:40 +00:00
|
|
|
$table->dropColumn(['original_sha256','optimized_sha256','caption','hls_path','hls_transcoded_at','key','metadata']);
|
2018-08-28 03:07:36 +00:00
|
|
|
});
|
2018-08-27 01:32:12 +00:00
|
|
|
}
|
|
|
|
}
|