2016-09-02 21:27:50 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreateUploadsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('uploads', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2016-09-05 12:01:30 +01:00
|
|
|
$table->unsignedInteger('album_id');
|
2016-09-02 21:27:50 +01:00
|
|
|
$table->boolean('is_completed');
|
|
|
|
$table->boolean('is_processing');
|
|
|
|
$table->integer('number_photos')->default(0);
|
|
|
|
$table->integer('number_successful')->default(0);
|
|
|
|
$table->integer('number_failed')->default(0);
|
|
|
|
$table->timestamps();
|
2016-09-05 12:01:30 +01:00
|
|
|
|
|
|
|
$table->foreign('album_id')
|
|
|
|
->references('id')->on('albums')
|
|
|
|
->onDelete('cascade');
|
2016-09-02 21:27:50 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('uploads');
|
|
|
|
}
|
|
|
|
}
|