Add new migration

This commit is contained in:
Daniel Supernault 2018-10-20 21:45:00 -06:00
parent 463d9427c5
commit 1e16e18ae6
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateMediaAddAltText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('media', function (Blueprint $table) {
$table->string('license')->nullable()->after('filter_class');
$table->boolean('is_nsfw')->default(false)->after('user_id');
$table->tinyInteger('version')->default(1);
$table->boolean('remote_media')->default(false)->after('is_nsfw');
$table->string('remote_url')->nullable()->after('thumbnail_url');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('license');
$table->dropColumn('is_nsfw');
$table->dropColumn('version');
$table->dropColumn('remote_media');
$table->dropColumn('remote_url');
});
}
}