remove id from File model and make 'hash' primary key

This commit is contained in:
j3d1 2019-12-24 17:50:42 +01:00
parent d815f64dc8
commit 4505c43bdd

View file

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DeleteIdOnFile extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('files', function (Blueprint $table) {
$table->dropColumn('id');
$table->primary('hash');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}