blue-twilight/database/migrations/2016_09_02_144354_create_uploads_table.php

42 lines
1.0 KiB
PHP

<?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');
$table->unsignedInteger('album_id');
$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();
$table->foreign('album_id')
->references('id')->on('albums')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('uploads');
}
}