2018-04-16 01:26:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreateMediaTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('media', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2018-05-20 02:56:20 +00:00
|
|
|
$table->bigInteger('status_id')->unsigned()->nullable();
|
|
|
|
$table->bigInteger('profile_id')->unsigned()->nullable();
|
|
|
|
$table->bigInteger('user_id')->unsigned()->nullable();
|
2018-04-16 01:26:48 +00:00
|
|
|
$table->string('media_path');
|
2018-05-20 02:56:20 +00:00
|
|
|
$table->string('thumbnail_path')->nullable();
|
2018-04-16 01:26:48 +00:00
|
|
|
$table->string('cdn_url')->nullable();
|
2018-05-20 02:56:20 +00:00
|
|
|
$table->string('optimized_url')->nullable();
|
|
|
|
$table->string('thumbnail_url')->nullable();
|
2018-04-16 01:26:48 +00:00
|
|
|
$table->tinyInteger('order')->unsigned()->default(1);
|
|
|
|
$table->string('mime')->nullable();
|
|
|
|
$table->unsignedInteger('size')->nullable();
|
2018-05-20 02:56:20 +00:00
|
|
|
$table->string('orientation')->nullable();
|
2018-04-16 01:26:48 +00:00
|
|
|
$table->timestamp('processed_at')->nullable();
|
|
|
|
$table->unique(['status_id', 'media_path']);
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('media');
|
|
|
|
}
|
|
|
|
}
|